update info view
This commit is contained in:
parent
88550257c1
commit
a5295f284d
1 changed files with 17 additions and 13 deletions
|
@ -728,13 +728,14 @@ 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) {
|
||||||
|
if (!isMultiple || ui.updateResults) {
|
||||||
Ox.Request.clearCache();
|
Ox.Request.clearCache();
|
||||||
if (Ox.contains(['title', 'author', 'description'], key)) {
|
if (Ox.contains(['title', 'author', 'description'], key)) {
|
||||||
oml.$ui.info.updateElement();
|
oml.$ui.info.updateElement();
|
||||||
|
@ -748,9 +749,12 @@ oml.ui.infoView = function(externalData, isMixed) {
|
||||||
oml.$ui.browser.value(
|
oml.$ui.browser.value(
|
||||||
result.data.id, key, result.data[key]
|
result.data.id, key, result.data[key]
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
// FIXME: what is this?
|
||||||
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));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue