mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
re-did .tagged(..)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
67901ddc56
commit
2a74b95ff5
@ -445,16 +445,17 @@ var TagsPrototype = {
|
||||
//
|
||||
// XXX not sure if this is optimal...
|
||||
tagged: function(value, ...tags){
|
||||
var that = this
|
||||
tags = tags.length == 1 && tags[0] instanceof Array ?
|
||||
tags.shift()
|
||||
: tags
|
||||
return tags
|
||||
.reduce(function(res, tag){
|
||||
return res === false ?
|
||||
res
|
||||
// XXX do not like the back and forth set conversion here...
|
||||
: new Set(that.values(tag)).has(value) }, true) },
|
||||
var u = this.tags(value)
|
||||
while(tags.length > 0){
|
||||
if(this.match(tags.shift(), u).length == 0){
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
|
||||
|
||||
// Add/Remove/Modify tags API...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user