From 2733416cd472d908f9accc161c2d7f31219900be Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 6 Mar 2018 02:26:38 +0300 Subject: [PATCH] added dom events on start/ready/stop... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index a77a1176..c3be4b06 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -127,6 +127,7 @@ var base = require('features/base') // - fit N images/ribbons is neutral but might mean different things // depending on image and viewer proportions // - .scale is a bad way to go... +// XXX need to trigger an event on the container on start/stop... var ViewerActions = module.ViewerActions = actions.Actions({ config: { @@ -708,6 +709,33 @@ module.Viewer = core.ImageGridFeatures.Feature({ isApplicable: function(){ return this.runtime.browser }, handlers: [ + // bind system events to dom... + // + // XXX add: + // ig.created + // ig.ready + // XXX should these be imagegrid.event or ig.event?? + ['start.pre', + function(){ + this.dom.trigger('ig.start.pre') + return function(){ + this.dom.trigger('ig.start') + this.dom.trigger('ig.start.post') + } + }], + // XXX should we also do .pre/.post??? + ['ready', + function(){ + this.dom.trigger('ig.ready') }], + ['stop.pre', + function(){ + this.dom.trigger('ig.stop') + return function(){ + this.dom.trigger('ig.stop') + this.dom.trigger('ig.stop.post') + } + }], + ['start', function(){ var that = this