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...
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',

View File

@ -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