diff --git a/Viewer/features/marks.js b/Viewer/features/marks.js index 948b781a..71c87bd6 100755 --- a/Viewer/features/marks.js +++ b/Viewer/features/marks.js @@ -73,13 +73,22 @@ function makeTagTogglerAction(tag){ // the action... var action = function(target, action){ // gid list attr... - target = target in this ? - this[target] - : target + if(target in this){ + target = this[target] + target = target instanceof Array ? + target + : [target] } // reverse gid list attr... if(typeof(target) == typeof('str') && target[0] == '!'){ - var skip = new Set(this[target.slice(1)]) + target = target.slice(1) + target = target in this ? + this[target] + : target + target = target instanceof Array ? + target + : [target] + var skip = new Set(target) target = this.data.order .filter(function(gid){ return !skip.has(gid) }) } @@ -384,8 +393,7 @@ var ImageMarkEditActions = actions.Actions({ i++ } // do the marking... - return this.toggleMark(block, state ? 'off' : 'on') - }], + return this.toggleMark(block, state ? 'off' : 'on') }], toggleMarkRibbon: ['Mark/$Invert ribbon marks', 'toggleMark: "ribbon" ...' ], toggleMarkLoaded: ['Mark/Invert marks', diff --git a/Viewer/imagegrid/data.js b/Viewer/imagegrid/data.js index 3437d2ab..0a558e17 100755 --- a/Viewer/imagegrid/data.js +++ b/Viewer/imagegrid/data.js @@ -127,7 +127,8 @@ module.DATA_VERSION = '3.1' // decide to use a hashing function... var hash = typeof(sha1) != 'undefined' ? sha1.hash.bind(sha1) - : function(g){ return g } + : function(g){ + return g } /*********************************************************************/ @@ -1203,7 +1204,9 @@ var DataPrototype = { // normalize target and build the source list... // 'current' ribbon... - target = (target == 'current' + // NOTE: '===' here is by design i.e. 'current' means the current + // ribbon while ['current'] is a list with current image... + target = (target === 'current' || target == 'ribbon') ? this.current : target