done refactoring last fix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-03-15 03:55:36 +03:00
parent 3f752c7425
commit aafe5690a0

View File

@ -45,6 +45,9 @@ var SlideshowActions = actions.Actions({
], ],
}, },
resetSlideshowWorkspace: ['Slideshow/Reset workspace',
function(){ delete this.workspaces['slideshow'] }],
slideshowIntervalDialog: ['Slideshow/Slideshow interval...', slideshowIntervalDialog: ['Slideshow/Slideshow interval...',
widgets.makeUIDialog(function(parent){ widgets.makeUIDialog(function(parent){
var that = this var that = this
@ -179,8 +182,10 @@ var SlideshowActions = actions.Actions({
this.loadWorkspace('slideshow') this.loadWorkspace('slideshow')
} }
// XXX // disable getting in/out of single image mode via clicks...
this.config['single-image-toggle-on-click'] = false if(this.config['single-image-toggle-on-click']){
this.config['single-image-toggle-on-click'] = false
}
// start the timer... // start the timer...
this.__slideshouw_timer = setInterval(function(){ this.__slideshouw_timer = setInterval(function(){
@ -260,10 +265,24 @@ module.Slideshow = core.ImageGridFeatures.Feature({
} }
}], }],
// build the slideshow workspace for the first time if it's not // - build the slideshow workspace for the first time if it's not
// present yet (is null)... // present yet (is null)...
// - restore .config['single-image-toggle-on-click']
['loadWorkspace.pre', ['loadWorkspace.pre',
function(workspace){ function(workspace){
// going out of slideshow -> restore settings...
var data = this.workspaces[workspace] || {}
if(this.workspace == 'slideshow'){
if(!('single-image-toggle-on-click' in data)){
delete this.config['single-image-toggle-on-click']
} else {
this.config['single-image-toggle-on-click'] =
data['single-image-toggle-on-click']
}
}
// going into slideshow for first time -> setup...
if(workspace == 'slideshow' && this.workspaces['slideshow'] == null){ if(workspace == 'slideshow' && this.workspaces['slideshow'] == null){
return function(){ return function(){
this.loadWorkspace('ui-chrome-hidden') this.loadWorkspace('ui-chrome-hidden')