From 5f2d7d21887964d5c380e660f723756dce150e9c Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 1 Jan 2016 02:22:17 +0300 Subject: [PATCH] some cleanup... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/cli.js | 6 +----- ui (gen4)/features/ui.js | 10 ++++++---- ui (gen4)/ig.js | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/ui (gen4)/features/cli.js b/ui (gen4)/features/cli.js index e733c113..72cee230 100755 --- a/ui (gen4)/features/cli.js +++ b/ui (gen4)/features/cli.js @@ -43,8 +43,7 @@ module.CLI = core.ImageGridFeatures.Feature({ depends: ['base'], isApplicable: function(){ - return this.runtime == 'node' || this.runtime == 'nw' - }, + return this.runtime == 'node' || this.runtime == 'nw' }, handlers: [ ['start', @@ -106,9 +105,6 @@ module.CLI = core.ImageGridFeatures.Feature({ - - - /********************************************************************** * vim:set ts=4 sw=4 : */ return module }) diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index 985c716d..fa6da3ad 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -2816,7 +2816,10 @@ module.IndirectControl = core.ImageGridFeatures.Feature({ function(_, state){ if(state == null){ - return this.__touch_handler || 'none' + return (this.ribbons + && this.ribbons.viewer + && this.ribbons.viewer.data('hammer')) + || 'none' // on... } else if(state == 'handling-swipes'){ @@ -2824,13 +2827,13 @@ module.IndirectControl = core.ImageGridFeatures.Feature({ var viewer = this.ribbons.viewer // prevent multiple handlers... - if(this.__touch_handler){ + if(viewer.data('hammer') != null){ return } viewer.hammer() - var h = this.__touch_handler = viewer.data('hammer') + var h = viewer.data('hammer') h.get('swipe').set({direction: Hammer.DIRECTION_ALL}) viewer @@ -2847,7 +2850,6 @@ module.IndirectControl = core.ImageGridFeatures.Feature({ .off('swipeup') .off('swipedown') .removeData('hammer') - delete this.__touch_handler } }, diff --git a/ui (gen4)/ig.js b/ui (gen4)/ig.js index 8e98f381..ef9a6de0 100644 --- a/ui (gen4)/ig.js +++ b/ui (gen4)/ig.js @@ -1,6 +1,7 @@ #!/usr/bin/env node /********************************************************************** * +* ImageGrid.CLI entry point... * * **********************************************************************/ @@ -21,6 +22,7 @@ require = requirejs //--------------------------------------------------------------------- +// XXX need to automate this... var core = require('features/core') var base = require('features/base') var location = require('features/location') @@ -43,7 +45,6 @@ module.ImageGridFeatures = core.ImageGridFeatures - //--------------------------------------------------------------------- // setup actions and start... @@ -53,6 +54,5 @@ ImageGridFeatures - /********************************************************************** * vim:set ts=4 sw=4 : */