From c3db57922a846ecd0d8d8b3a46385020a6f29721 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 5 Jan 2016 15:58:18 +0530 Subject: [PATCH] fix editDialog.js --- static/js/editDialog.js | 10 +++++----- static/json/js.json | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/static/js/editDialog.js b/static/js/editDialog.js index f7dc23a..9c1975f 100644 --- a/static/js/editDialog.js +++ b/static/js/editDialog.js @@ -63,7 +63,7 @@ oml.ui.editDialog = function() { } function formatValue(value, key) { - return value === mixed ? Ox.formatLight(Ox._( + return value === mixed ? formatLight(Ox._( key == 'title' ? 'Mixed Title' : key == 'author' ? 'Mixed Author' : 'mixed' @@ -89,7 +89,7 @@ oml.ui.editDialog = function() { var data = {}, items = result.data.items; keys.forEach(function(key) { - values = items.map(function(item) { + var values = items.map(function(item) { return item[key]; }); var isArray = Ox.isArray(values[0]) @@ -100,7 +100,7 @@ oml.ui.editDialog = function() { } data[key] = Ox.unique(values).length == 1 ? (isArray ? values[0].split(separator) : values[0]) - : mixed; + : isArray ? [mixed] : mixed; }); callback(data); }); @@ -169,7 +169,7 @@ oml.ui.editDialog = function() { // Place, Publisher, Date - $div = $('') .css({ marginTop: '4px' }) @@ -206,4 +206,4 @@ oml.ui.editDialog = function() { return that; -}; \ No newline at end of file +}; diff --git a/static/json/js.json b/static/json/js.json index 10a8ae9..48f4b85 100644 --- a/static/json/js.json +++ b/static/json/js.json @@ -12,6 +12,7 @@ "connectionButton.js", "deleteItemsDialog.js", "deleteListDialog.js", + "editDialog.js", "errorDialog.js", "filter.js", "filtersInnerPanel.js",