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) {
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'
? splitValue(value || [], 'author')
: Ox.contains(arrayKeys, key)
? (value || '').split(separator)
: value;
oml.api.edit(edit, function(result) {
Ox.Request.clearCache();
if (Ox.contains(['title', 'author', 'description'], key)) {
oml.$ui.info.updateElement();
if (!isMultiple || ui.updateResults) {
Ox.Request.clearCache();
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) {
$filter.reloadList();
});
oml.$ui.list.value(
result.data.id, key, result.data[key]
);
oml.$ui.browser.value(
result.data.id, key, result.data[key]
);
// FIXME: what is this?
if (Ox.contains(['title', 'author'], key)) {
that.updateElement(result.data, [$data]);
}
that.triggerEvent('change', Ox.extend({}, key, value));
});
}
}