update info view

This commit is contained in:
rlx 2016-01-12 10:16:07 +05:30
parent 88550257c1
commit a5295f284d

View file

@ -728,29 +728,33 @@ oml.ui.infoView = function(externalData, isMixed) {
function editMetadata(key, value) { function editMetadata(key, value) {
if (value != data[key]) { if (value != data[key]) {
var edit = {id: !isMultiple ? data.id : oml.ui.listSelection}; var edit = {id: !isMultiple ? data.id : ui.listSelection};
edit[key] = key == 'author' edit[key] = key == 'author'
? splitValue(value || [], 'author') ? splitValue(value || [], 'author')
: Ox.contains(arrayKeys, key) : Ox.contains(arrayKeys, key)
? (value || '').split(separator) ? (value || '').split(separator)
: value; : value;
oml.api.edit(edit, function(result) { oml.api.edit(edit, function(result) {
Ox.Request.clearCache(); if (!isMultiple || ui.updateResults) {
if (Ox.contains(['title', 'author', 'description'], key)) { Ox.Request.clearCache();
oml.$ui.info.updateElement(); if (Ox.contains(['title', 'author', 'description'], key)) {
oml.$ui.info.updateElement();
}
oml.$ui.filters.forEach(function($filter) {
$filter.reloadList();
});
oml.$ui.list.value(
result.data.id, key, result.data[key]
);
oml.$ui.browser.value(
result.data.id, key, result.data[key]
);
} }
oml.$ui.filters.forEach(function($filter) { // FIXME: what is this?
$filter.reloadList();
});
oml.$ui.list.value(
result.data.id, key, result.data[key]
);
oml.$ui.browser.value(
result.data.id, key, result.data[key]
);
if (Ox.contains(['title', 'author'], key)) { if (Ox.contains(['title', 'author'], key)) {
that.updateElement(result.data, [$data]); that.updateElement(result.data, [$data]);
} }
that.triggerEvent('change', Ox.extend({}, key, value));
}); });
} }
} }