From ea6a79cc1025423533527c0f5d76c70a895e6565 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 5 Feb 2015 15:57:37 +0530 Subject: [PATCH] always use ui.part.documents and ui.part.entities, remove ui.document/ui.entity from default config, fixes #2064 --- pandora/config.0xdb.jsonc | 2 -- pandora/config.indiancinema.jsonc | 2 -- pandora/config.padma.jsonc | 2 -- pandora/config.pandora.jsonc | 2 -- static/js/documentDialog.js | 13 +++++-------- static/js/documentsPanel.js | 6 +++--- static/js/entityDialog.js | 2 +- 7 files changed, 9 insertions(+), 20 deletions(-) diff --git a/pandora/config.0xdb.jsonc b/pandora/config.0xdb.jsonc index 55ac063e..739331e5 100644 --- a/pandora/config.0xdb.jsonc +++ b/pandora/config.0xdb.jsonc @@ -853,7 +853,6 @@ "columnWidth": {} } }, - "document": "", "documents": {}, "documentSize": 256, "documentsSelection": {}, @@ -872,7 +871,6 @@ ], "editView": "list", "embedSize": 256, - "entity": "", "entitiesSelection": {}, "entitiesType": "", "filters": [ diff --git a/pandora/config.indiancinema.jsonc b/pandora/config.indiancinema.jsonc index 08b57e71..fe0a4126 100644 --- a/pandora/config.indiancinema.jsonc +++ b/pandora/config.indiancinema.jsonc @@ -868,7 +868,6 @@ "columnWidth": {} } }, - "document": "", "documents": {}, "documentSize": 256, "documentsSelection": {}, @@ -887,7 +886,6 @@ ], "editView": "list", "embedSize": 256, - "entity": "", "entitiesSelection": {}, "entitiesType": "", "filters": [ diff --git a/pandora/config.padma.jsonc b/pandora/config.padma.jsonc index 93f128ba..533f88c9 100644 --- a/pandora/config.padma.jsonc +++ b/pandora/config.padma.jsonc @@ -753,7 +753,6 @@ "columnWidth": {} } }, - "document": "", "documents": {}, "documentSize": 256, "documentsSelection": {}, @@ -772,7 +771,6 @@ ], "editView": "list", "embedSize": 256, - "entity": "", "entitiesSelection": {}, "entitiesType": "", "filters": [ diff --git a/pandora/config.pandora.jsonc b/pandora/config.pandora.jsonc index 13ca38f1..5e0d20d1 100644 --- a/pandora/config.pandora.jsonc +++ b/pandora/config.pandora.jsonc @@ -797,7 +797,6 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution. "columnWidth": {} } }, - "document": "", "documents": {}, "documentSize": 256, "documentsSelection": {}, @@ -816,7 +815,6 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution. ], "editView": "list", "embedSize": 256, - "entity": "", "entitiesSelection": {}, "entitiesType": "", "filters": [ diff --git a/static/js/documentDialog.js b/static/js/documentDialog.js index 116a528f..4cb8ad64 100644 --- a/static/js/documentDialog.js +++ b/static/js/documentDialog.js @@ -9,7 +9,7 @@ pandora.openDocumentDialog = function(options) { pandora.$ui.documentDialog && options.ids && options.ids.length == 1 && Ox.getObjectById(pandora.$ui.documentDialog.getItems(), options.ids[0]) ) { - pandora.UI.set({document: options.ids[0]}); + pandora.UI.set({'part.documents': options.ids[0]}); } else if (options.ids) { pandora.api.findDocuments({ query: { @@ -80,7 +80,7 @@ pandora.ui.documentDialog = function(options) { }) .bindEvent({ close: function() { - pandora.UI.set({document: ''}); + pandora.UI.set({'part.documents': ''}); delete pandora.$ui.documentDialog; }, resize: function(data) { @@ -95,7 +95,7 @@ pandora.ui.documentDialog = function(options) { {position: $content.getArea().map(Math.round)} ); }, - pandora_document: function(data) { + 'pandora_part.documents': function(data) { if (data.value) { if (Ox.getObjectById(items, data.value)) { item = Ox.getObjectById(items, data.value); @@ -109,7 +109,7 @@ pandora.ui.documentDialog = function(options) { } }, pandora_item: function(data) { - pandora.UI.set({document: ''}); + pandora.UI.set({'part.documents': ''}); } }), @@ -150,12 +150,9 @@ pandora.ui.documentDialog = function(options) { [items.length > 1 ? 'show' : 'hide']() .bindEvent({ click: function(data) { - var offset = data.id == 'previous' ? -1 : 1; - options.index = Ox.mod(options.index + offset, items.length); pandora.$ui[ isItemView ? 'documents' : 'documentsDialogPanel' - ].selectSelected(offset); - pandora.UI.set({document: items[options.index].id}); + ].selectSelected(data.id == 'previous' ? -1 : 1); } }); diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index f02b21b8..c2670425 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -740,15 +740,15 @@ pandora.ui.documentsPanel = function(options) { ); }, key_escape: function() { - pandora.UI.set({document: ''}); + pandora.UI.set({'part.documents': ''}); }, open: openDocuments, openpreview: openDocuments, select: function(data) { pandora.UI.set( - 'documentsSelection.' + (isItemView ? ui.item : ''), - data.ids + 'documentsSelection.' + (isItemView ? ui.item : ''), data.ids ); + ui.part.documents && pandora.UI.set('part.documents', data.ids[0]); }, sort: function(data) { pandora.UI.set({documentsSort: [data]}); diff --git a/static/js/entityDialog.js b/static/js/entityDialog.js index c0703bde..047d6c65 100644 --- a/static/js/entityDialog.js +++ b/static/js/entityDialog.js @@ -55,7 +55,7 @@ pandora.ui.entityDialog = function() { .bindEvent({ close: function() { pandora.UI.set({ - entity: '', + 'part.entities': '', page: '' }); delete pandora.$ui.entityDialog;