mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +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...
|
// XXX revise...
|
||||||
showStatusBarInfo: ['- Interface/',
|
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')
|
var bar = this.dom.find('.state-indicator-container.global-info')
|
||||||
|
|
||||||
if(text){
|
text ?
|
||||||
bar.find('.info').text(text)
|
bar.find('.info').text(text)
|
||||||
|
: bar.find('.info').empty()
|
||||||
|
|
||||||
} else {
|
// clear after timeout...
|
||||||
bar.find('.info').empty()
|
timeout
|
||||||
}
|
&& text && text.trim() != ''
|
||||||
}],
|
&& (this.__statusbar_info_timeout =
|
||||||
|
setTimeout(function(){
|
||||||
|
delete this.__statusbar_info_timeout
|
||||||
|
this.showStatusBarInfo() }.bind(this), timeout)) }],
|
||||||
})
|
})
|
||||||
|
|
||||||
var StatusBar =
|
var StatusBar =
|
||||||
|
|||||||
@ -2174,7 +2174,8 @@ module.PreviewFilters = core.ImageGridFeatures.Feature({
|
|||||||
|
|
||||||
tag: 'ui-preview-filters',
|
tag: 'ui-preview-filters',
|
||||||
depends: [
|
depends: [
|
||||||
'ui'
|
'ui',
|
||||||
|
'ui-status-bar',
|
||||||
],
|
],
|
||||||
|
|
||||||
config: {
|
config: {
|
||||||
@ -2263,6 +2264,11 @@ module.PreviewFilters = core.ImageGridFeatures.Feature({
|
|||||||
handlers: [
|
handlers: [
|
||||||
['focusImage',
|
['focusImage',
|
||||||
function(){ this.togglePreviewFilter('No filters') }],
|
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