From f64d93ad1e9e4934b6e5eaafca589c76cc6c9cad Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 10 Jan 2014 16:08:33 +0400 Subject: [PATCH] minor stuff... Signed-off-by: Alex A. Naanou --- ui/lib/editor.js | 25 +++++++++++++++++++++++++ ui/lib/panels.js | 4 +++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ui/lib/editor.js b/ui/lib/editor.js index d1948970..01d95560 100755 --- a/ui/lib/editor.js +++ b/ui/lib/editor.js @@ -331,9 +331,12 @@ Panel('Edit: Filters', }, // setup... function(panel){ + // NOTE: we need to have this in the namespace so as to be able + // to both register and drop event handlers... var _editorUpdateor = function(){ reloadControls('.current.image') } + panel .on('panelOpening', function(){ // register updater... @@ -347,6 +350,28 @@ Panel('Edit: Filters', $('.viewer') .off('focusingImage', _editorUpdateor) }) + + /* + // XXX a different approach... + // XXX not yet sure which approach is better... + // XXX this has one draw back -- the handler is allways there... + // ...depending on how fast isPanelVisible(..) is, this might + // not be a problem, especially if the panel is also allways + // there... + var _editorUpdateor = function(){ + if(isPanelVisible(panel)){ + reloadControls('.current.image') + } + } + $('.viewer') + .on('focusingImage', _editorUpdateor) + + panel + .on('panelOpening', function(){ + // update the editor state in case the target changed... + _editorUpdateor() + }) + */ }, true) diff --git a/ui/lib/panels.js b/ui/lib/panels.js index b488288f..143b5f93 100755 --- a/ui/lib/panels.js +++ b/ui/lib/panels.js @@ -489,10 +489,12 @@ function openPanel(panel, parent, no_blink){ } -// open a set of sub-panels in one panel... +// Open a set of sub-panels in one parent panel... // // returns the parent panel. // +// NOTE: if parent is given and already exists then this will append the +// new panels to it... // NOTE: this will not re-group already opened panels... function openGroupedPanels(panels, parent){ panels = typeof(panels) == typeof('str') ? [panels] : panels