some cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-05-21 19:05:48 +03:00
parent 8e9aa684ab
commit b810a47fbb
2 changed files with 44 additions and 7 deletions

View File

@ -717,7 +717,29 @@ var StatusBarActions = actions.Actions({
// XXX revise... // XXX revise...
showStatusBarInfo: ['- Interface/', showStatusBarInfo: ['- Interface/',
function(text, timeout){ core.doc`
Show info...
.showStatusBarInfo(text)
Show info for timeout then fadeout...
.showStatusBarInfo(text, timeout)
.showStatusBarInfo(text, timeout, fadeout)
Hide info...
.showStatusBarInfo()
.showStatusBarInfo('')
Fadeout info for timeout...
.showStatusBarInfo(fadeout)
`,
function(text, timeout, fadeout){
timeout = timeout === true ?
1000
: timeout
fadeout = fadeout || 200
// reset clear timeout... // reset clear timeout...
this.__statusbar_info_timeout this.__statusbar_info_timeout
&& clearTimeout(this.__statusbar_info_timeout) && clearTimeout(this.__statusbar_info_timeout)
@ -725,17 +747,32 @@ var StatusBarActions = actions.Actions({
var bar = this.dom.find('.state-indicator-container.global-info') var bar = this.dom.find('.state-indicator-container.global-info')
text ? // update the element...
bar.find('.info').text(text) // show...
: bar.find('.info').empty() ;(typeof(text) == typeof('str')
&& text.trim().length > 0) ?
bar.find('.info')
.empty()
.show()
.text(text)
// fadeout...
: typeof(text) == typeof(123) ?
bar.find('.info')
.fadeOut(text, function(){
$(this).empty() })
// hide...
: bar.find('.info')
.empty()
.show()
// clear after timeout... // clear after timeout...
timeout timeout
&& text && text.trim() != '' && text && text.trim() != ''
&& (this.__statusbar_info_timeout = && (this.__statusbar_info_timeout =
setTimeout(function(){ setTimeout(function(){
delete this.__statusbar_info_timeout delete this.__statusbar_info_timeout
this.showStatusBarInfo() }.bind(this), timeout)) }], this.showStatusBarInfo(fadeout) }.bind(this),
timeout)) }],
}) })
var StatusBar = var StatusBar =

View File

@ -2267,7 +2267,7 @@ module.PreviewFilters = core.ImageGridFeatures.Feature({
['togglePreviewFilter', ['togglePreviewFilter',
function(res){ function(res){
res != 'No filters' ? res != 'No filters' ?
this.showStatusBarInfo(res, 3000) this.showStatusBarInfo(res, 1000)
: this.showStatusBarInfo() }], : this.showStatusBarInfo() }],
], ],
}) })