a better cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-05-21 19:28:28 +03:00
parent b810a47fbb
commit 672bd773a6

View File

@ -735,6 +735,7 @@ var StatusBarActions = actions.Actions({
`, `,
function(text, timeout, fadeout){ function(text, timeout, fadeout){
var that = this
timeout = timeout === true ? timeout = timeout === true ?
1000 1000
: timeout : timeout
@ -745,25 +746,19 @@ var StatusBarActions = actions.Actions({
&& clearTimeout(this.__statusbar_info_timeout) && clearTimeout(this.__statusbar_info_timeout)
delete 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 .info')
// update the element... // update the element...
// show...
;(typeof(text) == typeof('str')
&& text.trim().length > 0) ?
bar.find('.info')
.empty()
.show()
.text(text)
// fadeout... // fadeout...
: typeof(text) == typeof(123) ? typeof(text) == typeof(123) ?
bar.find('.info') bar.fadeOut(text, function(){
.fadeOut(text, function(){ that.showStatusBarInfo() })
$(this).empty() }) // show/hide...
// hide... : bar
: bar.find('.info') .text(text || '')
.empty() .stop()
.show() .show()
.css({opacity: ''})
// clear after timeout... // clear after timeout...
timeout timeout