added a 'single-image' workspace + added push/pop worspace actions...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-05-07 00:47:52 +03:00
parent 58b1672ab8
commit 14d1b9410e
5 changed files with 67 additions and 13 deletions

View File

@ -1251,6 +1251,22 @@ stretching in width... */
content: "Global";
}
/* gid */
.overlay-info .gid {
opacity: 0.7;
}
.overlay-info .gid:hover {
opacity: 1;
}
.overlay-info .path {
opacity: 0.7;
}
.overlay-info .path:hover {
opacity: 1;
}
/*************************************************** Global status ***/

View File

@ -330,6 +330,8 @@ module.makeWorkspaceConfigLoader = function(keys, callback){
var WorkspaceActions = actions.Actions({
config: {
'load-workspace': 'default',
'workspace': 'default',
'workspaces': {},
},
@ -396,6 +398,28 @@ var WorkspaceActions = actions.Actions({
makeConfigToggler('workspace',
function(){ return Object.keys(this.config['workspaces']) },
function(state){ this.loadWorkspace(state) })],
pushWorkspace: ['- Workspace/',
function(name){
name = name || this.workspace
var stack = this.__workspace_stack = this.__workspace_stack || []
this.saveWorkspace()
this.workspace != name && this.loadWorkspace(name)
stack.push(name)
}],
popWorkspace: ['- Workspace/',
function(){
var stack = this.__workspace_stack
if(!stack || stack.length == 0){
return
}
this.saveWorkspace()
this.loadWorkspace(stack.pop())
}],
})
@ -412,8 +436,12 @@ module.Workspace = ImageGridFeatures.Feature({
actions: WorkspaceActions,
handlers: [
['start',
function(){
this.loadWorkspace(this.config['load-workspace'] || 'default') }],
['stop',
function(){ this.saveWorkspace() }],
function(){
this.saveWorkspace() }],
],
})

View File

@ -226,7 +226,22 @@ var SingleImageActions = actions.Actions({
toggleSingleImage: ['Interface/Toggle single image view',
toggler.CSSClassToggler(
function(){ return this.ribbons.viewer },
'single-image-mode') ],
'single-image-mode',
function(state){
if(state == 'on'){
this.pushWorkspace()
if(this.workspaces['single-image'] == null){
this.loadWorkspace('ui-chrome-hidden')
this.saveWorkspace('single-image')
}
this.loadWorkspace('single-image')
} else {
this.popWorkspace()
}
})],
})

View File

@ -183,9 +183,11 @@ var SlideshowActions = actions.Actions({
// prepare for the slideshow...
} else {
// single image mode...
this.toggleSingleImage('on')
// save current workspace...
this.__pre_slideshow_workspace = this.workspace
this.saveWorkspace()
this.pushWorkspace()
// construct the slideshow workspace if it does
// not exist...
@ -199,9 +201,6 @@ var SlideshowActions = actions.Actions({
// load the slideshow workspace...
this.loadWorkspace('slideshow')
// single image mode...
this.toggleSingleImage('on')
}
// start the timer...
@ -230,17 +229,13 @@ var SlideshowActions = actions.Actions({
// stop...
} else {
this.saveWorkspace('slideshow')
// stop timer...
this.__slideshouw_timer
&& clearInterval(this.__slideshouw_timer)
delete this.__slideshouw_timer
// restore the original workspace...
this.__pre_slideshow_workspace &&
this.loadWorkspace(this.__pre_slideshow_workspace)
delete this.__pre_slideshow_workspace
this.popWorkspace()
}
})],

View File

@ -307,7 +307,7 @@ var StatusBarActions = actions.Actions({
var bar = this.ribbons.viewer.find('.state-indicator-container.global-info')
if(bar.length == 0){
bar = makeStateIndicator('global-info overlay-info')
bar = makeStateIndicator('global-info overlay-info statusbar')
.addClass(this.config['status-bar-mode'] || '')
.on('mouseover', function(){
var t = $(event.target)