some fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-11-13 03:45:02 +03:00
parent ecb1458f93
commit 3eb788b02e
2 changed files with 25 additions and 1 deletions

View File

@ -335,6 +335,11 @@ module.ImagesPrototype = {
forEach: function(func){ forEach: function(func){
var i = 0 var i = 0
for(var key in this){ 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) func.call(this[key], key, this[key], i++, this)
} }
return this return this
@ -343,6 +348,11 @@ module.ImagesPrototype = {
var res = this.constructor() var res = this.constructor()
var i = 0 var i = 0
for(var key in this){ 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) res[k] = func.call(this[key], key, this[key], i++, this)
} }
return res return res
@ -351,6 +361,11 @@ module.ImagesPrototype = {
var res = this.constructor() var res = this.constructor()
var i = 0 var i = 0
for(var key in this){ 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)){ if(func.call(this[key], key, this[key], i++, this)){
res[key] = this[key] res[key] = this[key]
} }
@ -360,6 +375,11 @@ module.ImagesPrototype = {
reduce: function(func, initial){ reduce: function(func, initial){
var res = initial var res = initial
for(var key in this){ 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) res = func.call(this[key], res, this[key], key, i++, this)
} }
return res return res

View File

@ -2343,6 +2343,9 @@ var drawer = require('lib/widget/drawer')
// handled // handled
// .close() // .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){ var makeActionLister = function(list, filter, pre_order){
pre_order = typeof(filter) == typeof(true) ? 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({ var ActionTreeActions = actions.Actions({
// XXX move this to a generic modal overlay feature... // XXX move this to a generic modal overlay feature...
getOverlay: ['Interface/Get overlay object', getOverlay: ['Interface/Get overlay object',
function(){ function(o){
return overlay.getOverlay(o || this.viewer)
}], }],
browseActions: ['Interface/Browse actions', browseActions: ['Interface/Browse actions',