mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-02 04:10:11 +00:00
several bug fixes and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
7970a23c31
commit
82cd756fd9
@ -1958,12 +1958,16 @@ var DataWithTagsPrototype = {
|
|||||||
// get tag state...
|
// get tag state...
|
||||||
} else if(action == '?'){
|
} else if(action == '?'){
|
||||||
if(this.tags == null){
|
if(this.tags == null){
|
||||||
return gids.map(function(gid){ return 'off' })
|
return gids.length > 1 ? gids.map(function(gid){ return 'off' }) : 'off'
|
||||||
}
|
}
|
||||||
var that = this
|
var that = this
|
||||||
var tagset = this.tags
|
var tagset = this.tags
|
||||||
var order = this.order
|
var order = this.order
|
||||||
var res = gids.map(function(gid){
|
var res = gids.map(function(gid){
|
||||||
|
gid = that.getImage(gid)
|
||||||
|
if(!(tag in tagset)){
|
||||||
|
return 'off'
|
||||||
|
}
|
||||||
//return that.getTags(gid).indexOf(tag) != -1 ? 'on' : 'off'
|
//return that.getTags(gid).indexOf(tag) != -1 ? 'on' : 'off'
|
||||||
return tagset[tag][order.indexOf(gid)] != null ? 'on' : 'off'
|
return tagset[tag][order.indexOf(gid)] != null ? 'on' : 'off'
|
||||||
})
|
})
|
||||||
@ -1974,8 +1978,9 @@ var DataWithTagsPrototype = {
|
|||||||
var tagset = this.tags
|
var tagset = this.tags
|
||||||
var order = this.order
|
var order = this.order
|
||||||
var res = gids.map(function(gid){
|
var res = gids.map(function(gid){
|
||||||
|
gid = that.getImage(gid)
|
||||||
//var t = that.getTags(gid).indexOf(tag) != -1 ? 'off' : 'on'
|
//var t = that.getTags(gid).indexOf(tag) != -1 ? 'off' : 'on'
|
||||||
var t = tagset == null ? 'on'
|
var t = tagset == null || !(tag in tagset) ? 'on'
|
||||||
: tagset[tag][order.indexOf(gid)] == null ? 'on'
|
: tagset[tag][order.indexOf(gid)] == null ? 'on'
|
||||||
: 'off'
|
: 'off'
|
||||||
if(t == 'on'){
|
if(t == 'on'){
|
||||||
|
|||||||
@ -1779,6 +1779,11 @@ var ImageMarkActions = actions.Actions({
|
|||||||
// XXX make this a real toggler... ???
|
// XXX make this a real toggler... ???
|
||||||
toggleMark: ['',
|
toggleMark: ['',
|
||||||
function(target, action){
|
function(target, action){
|
||||||
|
if(target == '?' || target == 'on' || target == 'off'){
|
||||||
|
var x = action
|
||||||
|
action = target
|
||||||
|
target = x
|
||||||
|
}
|
||||||
target = target || 'current'
|
target = target || 'current'
|
||||||
target = target == 'all'
|
target = target == 'all'
|
||||||
|| target == 'loaded'
|
|| target == 'loaded'
|
||||||
@ -1790,17 +1795,20 @@ var ImageMarkActions = actions.Actions({
|
|||||||
|
|
||||||
var res = this.data.toggleTag('selected', target, action)
|
var res = this.data.toggleTag('selected', target, action)
|
||||||
|
|
||||||
if(this.ribbons != null){
|
if(action != '?' && this.ribbons != null){
|
||||||
var that = this
|
var that = this
|
||||||
target.forEach(function(t){
|
target.forEach(function(t){
|
||||||
that.ribbons.toggleImageMark(t, 'selected', action)
|
that.ribbons.toggleImageMark(t, 'selected', action)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return res
|
return res
|
||||||
}],
|
}],
|
||||||
toggleMarkBlock: ['',
|
toggleMarkBlock: ['',
|
||||||
function(){
|
function(target){
|
||||||
|
var cur = this.toggleMark(target, '?')
|
||||||
|
|
||||||
|
// get all the next/prev gids until we get a state other than cur...
|
||||||
// XXX
|
// XXX
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user