From 3eb788b02e725583954cb0e26315ff725530832a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 13 Nov 2015 03:45:02 +0300 Subject: [PATCH] some fixes... Signed-off-by: Alex A. Naanou --- ui (gen4)/images.js | 20 ++++++++++++++++++++ ui (gen4)/viewer.js | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ui (gen4)/images.js b/ui (gen4)/images.js index 6affbdaf..0a17e21b 100755 --- a/ui (gen4)/images.js +++ b/ui (gen4)/images.js @@ -335,6 +335,11 @@ module.ImagesPrototype = { forEach: function(func){ var i = 0 for(var key in this){ + // reject non images... + // XXX make this cleaner... + if(key == 'length' || typeof(this[key]) == typeof(function(){})){ + continue + } func.call(this[key], key, this[key], i++, this) } return this @@ -343,6 +348,11 @@ module.ImagesPrototype = { var res = this.constructor() var i = 0 for(var key in this){ + // reject non images... + // XXX make this cleaner... + if(key == 'length' || typeof(this[key]) == typeof(function(){})){ + continue + } res[k] = func.call(this[key], key, this[key], i++, this) } return res @@ -351,6 +361,11 @@ module.ImagesPrototype = { var res = this.constructor() var i = 0 for(var key in this){ + // reject non images... + // XXX make this cleaner... + if(key == 'length' || typeof(this[key]) == typeof(function(){})){ + continue + } if(func.call(this[key], key, this[key], i++, this)){ res[key] = this[key] } @@ -360,6 +375,11 @@ module.ImagesPrototype = { reduce: function(func, initial){ var res = initial for(var key in this){ + // reject non images... + // XXX make this cleaner... + if(key == 'length' || typeof(this[key]) == typeof(function(){})){ + continue + } res = func.call(this[key], res, this[key], key, i++, this) } return res diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index 3d8f19f4..bf9346cf 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -2343,6 +2343,9 @@ var drawer = require('lib/widget/drawer') // handled // .close() // +// XXX need a way to prevent closing ONLY if action is run FROM the +// list... +// ...the current solution does not have this problem... // var makeActionLister = function(list, filter, pre_order){ pre_order = typeof(filter) == typeof(true) ? filter : pre_order @@ -2441,7 +2444,8 @@ var makeActionLister = function(list, filter, pre_order){ var ActionTreeActions = actions.Actions({ // XXX move this to a generic modal overlay feature... getOverlay: ['Interface/Get overlay object', - function(){ + function(o){ + return overlay.getOverlay(o || this.viewer) }], browseActions: ['Interface/Browse actions',