cleanup of tag status handler logic...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-02-16 05:53:33 +03:00
parent 71faf29359
commit 87f77e804a

View File

@ -357,18 +357,23 @@ module.ImageStateIndicator = core.ImageGridFeatures.Feature({
this.toggleStateIndicator(this.config['global-state-indicator-mode'])
}
}],
['focusImage',
function(){
this.updateStateIndicators()
}],
[[
'focusImage',
// XXX these might not be the right way to go because these
// will get triggered on batch operations and the such...
// ...one way to fix this is to test if it's the current
// image being updated and do nothing otherwise...
'tag',
'untag',
],
function(){
this.updateStateIndicators()
}]
function(res, tags, gids){
// trigger only when current image is affected...
if(gids.constructor === Array
&& (gids.indexOf('current') >= 0
|| gids.indexOf(this.current) >= 0)
|| this.data.getImage(gids) == this.current){
this.updateStateIndicators()
}
}],
],
})