From 4445b33718be8603dc5eaa1304fb01a5831ada7f Mon Sep 17 00:00:00 2001 From: j Date: Mon, 17 Apr 2017 18:18:10 +0200 Subject: [PATCH] add ui.editSidebarSize and update on resize, fixes #2716 --- pandora/config.0xdb.jsonc | 1 + pandora/config.indiancinema.jsonc | 1 + pandora/config.padma.jsonc | 1 + pandora/config.pandora.jsonc | 1 + static/js/editPanel.js | 15 ++++----------- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pandora/config.0xdb.jsonc b/pandora/config.0xdb.jsonc index 71d6054d..38299b3c 100644 --- a/pandora/config.0xdb.jsonc +++ b/pandora/config.0xdb.jsonc @@ -1226,6 +1226,7 @@ "edit": "", "edits": {}, "editSelection": [], + "editSidebarSize": 416, "editSort": [ {"key": "index", "operator": "+"}, {"key": "year", "operator": "+"}, diff --git a/pandora/config.indiancinema.jsonc b/pandora/config.indiancinema.jsonc index 4939ea95..8e4c47a4 100644 --- a/pandora/config.indiancinema.jsonc +++ b/pandora/config.indiancinema.jsonc @@ -1697,6 +1697,7 @@ "edit": "", "edits": {}, "editSelection": [], + "editSidebarSize": 416, "editSort": [ {"key": "index", "operator": "+"}, {"key": "year", "operator": "+"}, diff --git a/pandora/config.padma.jsonc b/pandora/config.padma.jsonc index 6982cc2b..e7e52b63 100644 --- a/pandora/config.padma.jsonc +++ b/pandora/config.padma.jsonc @@ -1177,6 +1177,7 @@ "edit": "", "edits": {}, "editSelection": [], + "editSidebarSize": 416, "editSort": [ {"key": "index", "operator": "+"}, {"key": "director", "operator": "+"}, diff --git a/pandora/config.pandora.jsonc b/pandora/config.pandora.jsonc index 54e57fde..a96d91ac 100644 --- a/pandora/config.pandora.jsonc +++ b/pandora/config.pandora.jsonc @@ -1117,6 +1117,7 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution. "edit": "", "edits": {}, "editSelection": [], + "editSidebarSize": 416, "editSort": [ {"key": "index", "operator": "+"}, {"key": "year", "operator": "+"}, diff --git a/static/js/editPanel.js b/static/js/editPanel.js index 79c5d25c..86576b6a 100644 --- a/static/js/editPanel.js +++ b/static/js/editPanel.js @@ -4,12 +4,6 @@ pandora.ui.editPanel = function(isEmbed) { var ui = pandora.user.ui, edit, - listSizes = [ - 144 + Ox.UI.SCROLLBAR_SIZE, - 280 + Ox.UI.SCROLLBAR_SIZE, - 416 + Ox.UI.SCROLLBAR_SIZE - ], - listSize = listSizes[ui.clipColumns], smallTimelineCanvas, smallTimelineContext, that = Ox.Element(); @@ -83,12 +77,11 @@ pandora.ui.editPanel = function(isEmbed) { annotationsCalendarSize: ui.annotationsCalendarSize, annotationsMapSize: ui.annotationsMapSize, annotationsRange: ui.annotationsRange, - annotationsSize: ui.annotationsSize, annotationsSort: ui.annotationsSort, clickLink: pandora.clickLink, clipRatio: pandora.site.video.previewRatio, clips: Ox.clone(edit.clips), - clipSize: listSize, + clipSize: ui.editSidebarSize + Ox.UI.SCROLLBAR_SIZE, clipTooltip: 'clips ' + Ox.SYMBOLS.shift + 'C', clipView: ui.edits[ui.edit].view, controlsTooltips: { @@ -155,6 +148,9 @@ pandora.ui.editPanel = function(isEmbed) { width: Ox.$document.width() - pandora.$ui.mainPanel.size(0) - 1 }) .bindEvent({ + clipSize: function(data) { + pandora.UI.set({editSidebarSize: data.size - Ox.UI.SCROLLBAR_SIZE}); + }, copy: function(data) { var ids = Ox.sort(data.ids, function(id) { return Ox.getObjectById(edit.clips, id).index; @@ -334,9 +330,6 @@ pandora.ui.editPanel = function(isEmbed) { select: function(data) { pandora.UI.set({editSelection: data.ids}); }, - size: function(data) { - pandora.UI.set({clipSize: data.size}); - }, sort: function(data) { pandora.UI.set({editSort: data}); sortClips(updateClips);