From 63a890a8773c82d5046be195e718a0d07410d6d0 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 6 Mar 2018 02:37:32 +0300 Subject: [PATCH] some cleanup, notes + added ig.attached DOM event... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-blank-render.js | 2 ++ ui (gen4)/features/ui-preact-render.js | 2 ++ ui (gen4)/features/ui-ribbons.js | 2 ++ ui (gen4)/features/ui.js | 15 +++++++++++---- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ui (gen4)/features/ui-blank-render.js b/ui (gen4)/features/ui-blank-render.js index 73069656..f75398e3 100755 --- a/ui (gen4)/features/ui-blank-render.js +++ b/ui (gen4)/features/ui-blank-render.js @@ -80,6 +80,8 @@ var RenderActions = actions.Actions({ // XXX is this correct??? //this.ribbons.__image_updaters = [this.updateImage.bind(this)] + this.dom.trigger('ig.attached') + } else { //this.ribbons.clear() this.ribbons.images = this.images diff --git a/ui (gen4)/features/ui-preact-render.js b/ui (gen4)/features/ui-preact-render.js index 4885cacc..a581c432 100755 --- a/ui (gen4)/features/ui-preact-render.js +++ b/ui (gen4)/features/ui-preact-render.js @@ -236,6 +236,8 @@ var RenderActions = actions.Actions({ // XXX is this correct??? //this.ribbons.__image_updaters = [this.updateImage.bind(this)] + this.dom.trigger('ig.attached') + } else { //this.ribbons.clear() this.ribbons.images = this.images diff --git a/ui (gen4)/features/ui-ribbons.js b/ui (gen4)/features/ui-ribbons.js index b46b73e6..ee2ea909 100755 --- a/ui (gen4)/features/ui-ribbons.js +++ b/ui (gen4)/features/ui-ribbons.js @@ -127,6 +127,8 @@ actions.Actions({ // XXX is this correct??? this.ribbons.__image_updaters = [this.updateImage.bind(this)] + this.dom.trigger('ig.attached') + } else { this.ribbons.clear() this.ribbons.images = this.images diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index c3be4b06..96114abf 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -711,9 +711,16 @@ module.Viewer = core.ImageGridFeatures.Feature({ handlers: [ // bind system events to dom... // - // XXX add: - // ig.created - // ig.ready + // Events: + // ig.attached + // triggered when ImageGrid instance is attached to dom... + // ig.start / ig.start.pre / ig.start.post + // ig.ready + // ig.stop / ig.stop.pre / ig.stop.post + // + // NOTE: ig.attached is triggered by the 'ui-render' implementation... + // NOTE: there is intentionally not pre/post ready events. (??? + // // XXX should these be imagegrid.event or ig.event?? ['start.pre', function(){ @@ -736,6 +743,7 @@ module.Viewer = core.ImageGridFeatures.Feature({ } }], + // workspaces and resizing... ['start', function(){ var that = this @@ -802,7 +810,6 @@ module.Viewer = core.ImageGridFeatures.Feature({ 'addClass' : 'removeClass']('crop-mode') }], - ], })