regression bug fix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-11-07 14:00:50 +03:00
parent a07a69c0f5
commit 1eac481159
2 changed files with 19 additions and 8 deletions

View File

@ -73,13 +73,22 @@ function makeTagTogglerAction(tag){
// the action... // the action...
var action = function(target, action){ var action = function(target, action){
// gid list attr... // gid list attr...
target = target in this ? if(target in this){
this[target] target = this[target]
: target target = target instanceof Array ?
target
: [target] }
// reverse gid list attr... // reverse gid list attr...
if(typeof(target) == typeof('str') if(typeof(target) == typeof('str')
&& target[0] == '!'){ && 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 target = this.data.order
.filter(function(gid){ .filter(function(gid){
return !skip.has(gid) }) } return !skip.has(gid) }) }
@ -384,8 +393,7 @@ var ImageMarkEditActions = actions.Actions({
i++ } i++ }
// do the marking... // do the marking...
return this.toggleMark(block, state ? 'off' : 'on') return this.toggleMark(block, state ? 'off' : 'on') }],
}],
toggleMarkRibbon: ['Mark/$Invert ribbon marks', toggleMarkRibbon: ['Mark/$Invert ribbon marks',
'toggleMark: "ribbon" ...' ], 'toggleMark: "ribbon" ...' ],
toggleMarkLoaded: ['Mark/Invert marks', toggleMarkLoaded: ['Mark/Invert marks',

View File

@ -127,7 +127,8 @@ module.DATA_VERSION = '3.1'
// decide to use a hashing function... // decide to use a hashing function...
var hash = typeof(sha1) != 'undefined' ? var hash = typeof(sha1) != 'undefined' ?
sha1.hash.bind(sha1) 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... // normalize target and build the source list...
// 'current' ribbon... // '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') ? || target == 'ribbon') ?
this.current this.current
: target : target