mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
added optional timeout to status-bar info + now announcing image filters...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8b98cacfd3
commit
b21cf47b23
@ -717,16 +717,25 @@ var StatusBarActions = actions.Actions({
|
||||
|
||||
// XXX revise...
|
||||
showStatusBarInfo: ['- Interface/',
|
||||
function(text){
|
||||
function(text, timeout){
|
||||
// reset clear timeout...
|
||||
this.__statusbar_info_timeout
|
||||
&& clearTimeout(this.__statusbar_info_timeout)
|
||||
delete this.__statusbar_info_timeout
|
||||
|
||||
var bar = this.dom.find('.state-indicator-container.global-info')
|
||||
|
||||
if(text){
|
||||
text ?
|
||||
bar.find('.info').text(text)
|
||||
: bar.find('.info').empty()
|
||||
|
||||
} else {
|
||||
bar.find('.info').empty()
|
||||
}
|
||||
}],
|
||||
// clear after timeout...
|
||||
timeout
|
||||
&& text && text.trim() != ''
|
||||
&& (this.__statusbar_info_timeout =
|
||||
setTimeout(function(){
|
||||
delete this.__statusbar_info_timeout
|
||||
this.showStatusBarInfo() }.bind(this), timeout)) }],
|
||||
})
|
||||
|
||||
var StatusBar =
|
||||
|
||||
@ -2174,7 +2174,8 @@ module.PreviewFilters = core.ImageGridFeatures.Feature({
|
||||
|
||||
tag: 'ui-preview-filters',
|
||||
depends: [
|
||||
'ui'
|
||||
'ui',
|
||||
'ui-status-bar',
|
||||
],
|
||||
|
||||
config: {
|
||||
@ -2263,6 +2264,11 @@ module.PreviewFilters = core.ImageGridFeatures.Feature({
|
||||
handlers: [
|
||||
['focusImage',
|
||||
function(){ this.togglePreviewFilter('No filters') }],
|
||||
['togglePreviewFilter',
|
||||
function(res){
|
||||
res != 'No filters' ?
|
||||
this.showStatusBarInfo(res, 1000)
|
||||
: this.showStatusBarInfo() }],
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user