more tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-04-20 17:53:43 +03:00
parent 800cc11c7a
commit dad312daa4
2 changed files with 12 additions and 27 deletions

View File

@ -438,21 +438,15 @@ var makeIndicatorHiderOnFastAction = function(hide_timeout){
var cur = this.current var cur = this.current
var hide = function(){
delete that.__current_indicator_t0
m.css({ opacity: 0 })
}
var show = function(){
delete that.__current_indicator_t0
m.animate({ opacity: 1 })
}
return function(){ return function(){
// delay fadeout... // delay fadeout...
if(cur != this.current if(cur != this.current
&& m.css('opacity') == 1 && m.css('opacity') == 1
&& this.__current_indicator_t0 == null){ && this.__current_indicator_t0 == null){
this.__current_indicator_t0 = setTimeout(hide, t) this.__current_indicator_t0 = setTimeout(function(){
delete that.__current_indicator_t0
m.css({ opacity: 0 })
}, t)
} }
// cancel/delay previous fadein... // cancel/delay previous fadein...
@ -468,7 +462,8 @@ var makeIndicatorHiderOnFastAction = function(hide_timeout){
&& clearTimeout(that.__current_indicator_t0) && clearTimeout(that.__current_indicator_t0)
delete that.__current_indicator_t0 delete that.__current_indicator_t0
show() // show...
m.animate({ opacity: 1 })
}, t-50) }, t-50)
} }
} }
@ -489,25 +484,17 @@ module.CurrentImageIndicatorHideOnFastScreenNav = core.ImageGridFeatures.Feature
exclusive: ['ui-current-image-indicator-hide'], exclusive: ['ui-current-image-indicator-hide'],
config: { config: {
'current-image-indicator-screen-hide-threshold': 100, 'current-image-indicator-hide-threshold': 100,
'current-image-indicator-hide-threshold': 250, 'current-image-indicator-screen-hide-threshold': 100,
}, },
handlers: [ handlers: [
// hide indicator on next/prev... // hide indicator on next/prev...
[[ ['prevImage.pre nextImage.pre',
'prevImage.pre', makeIndicatorHiderOnFastAction('current-image-indicator-hide-threshold')],
'nextImage.pre', ['prevScreen.pre nextScreen.pre',
], makeIndicatorHiderOnFastAction('current-image-indicator-screen-hide-threshold')],
makeIndicatorHiderOnFastAction(
'current-image-indicator-hide-threshold')],
[[
'prevImage.pre',
'nextImage.pre',
],
makeIndicatorHiderOnFastAction(
'current-image-indicator-screen-hide-threshold')],
], ],
}) })

View File

@ -64,7 +64,6 @@ var PartialRibbonsActions = actions.Actions({
this.__last_update = this.__last_update || t this.__last_update = this.__last_update || t
var timeout = this.config['ribbons-in-place-update-timeout'] var timeout = this.config['ribbons-in-place-update-timeout']
// localize transition prevention... // localize transition prevention...
// NOTE: we can't get ribbon via target directly here as // NOTE: we can't get ribbon via target directly here as
// the target might not be loaded... // the target might not be loaded...
@ -198,6 +197,5 @@ module.PartialRibbons = core.ImageGridFeatures.Feature({
/********************************************************************** /**********************************************************************
* vim:set ts=4 sw=4 : */ return module }) * vim:set ts=4 sw=4 : */ return module })