diff --git a/static/js/identifyDialog.js b/static/js/identifyDialog.js index 99c5fee..da1299e 100644 --- a/static/js/identifyDialog.js +++ b/static/js/identifyDialog.js @@ -4,6 +4,8 @@ oml.ui.identifyDialog = function(data) { var ui = oml.user.ui, + arrayKeys = ['author', 'publisher', 'place', 'language'], + $form = Ox.Element(), $findSelect = Ox.Select({ @@ -161,10 +163,19 @@ oml.ui.identifyDialog = function(data) { oml.api.edit(Ox.extend({ id: data.id }, Ox.filter( - $list.value($list.options('selected')[0]), + Ox.map( + $list.value($list.options('selected')[0]), + function(value, key) { + return value || ( + $updateSelect.value() == 'replace' + ? (Ox.contains(arrayKeys, key) ? [] : '') + : data[key] + ); + } + ), function(value, key) { return Ox.contains($list.options('keys'), key) - && value != data[key] + && !Ox.isEqual(value, data[key]); } )), function(result) { Ox.Request.clearCache('find');