mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
added browse action predicates to more actions...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
37f089cc91
commit
f1c4d558ea
@ -1031,6 +1031,8 @@ module.ImageGroupActions = actions.Actions({
|
||||
group: ['- Group|Edit/Group images',
|
||||
function(gids, group){ this.data.group(gids, group) }],
|
||||
ungroup: ['Group|Edit/Ungroup images',
|
||||
{browseMode: function(){
|
||||
return this.data.getGroup() == null && 'disabled' }},
|
||||
function(gids, group){ this.data.ungroup(gids, group) }],
|
||||
|
||||
// direction can be:
|
||||
@ -1066,11 +1068,17 @@ module.ImageGroupActions = actions.Actions({
|
||||
function(){ this.group(this.data.getImages(this.data.getTaggedByAny('marked'))) }],
|
||||
|
||||
expandGroup: ['Group/Expand group',
|
||||
{browseMode: function(){
|
||||
return this.data.getGroup() == null && 'disabled' }},
|
||||
function(target){ this.data.expandGroup(target || this.current) }],
|
||||
collapseGroup: ['Group/Collapse group',
|
||||
{browseMode: function(){
|
||||
return this.data.getGroup() == null && 'disabled' }},
|
||||
function(target){ this.data.collapseGroup(target || this.current) }],
|
||||
|
||||
cropGroup: ['Crop|Group/Crop group',
|
||||
{browseMode: function(){
|
||||
return this.data.getGroup() == null && 'disabled' }},
|
||||
function(target){ this.crop(this.data.cropGroup(target || this.current)) }],
|
||||
})
|
||||
|
||||
@ -1273,6 +1281,8 @@ module.Journal = core.ImageGridFeatures.Feature({
|
||||
// .redoLast(..)
|
||||
// XXX this is not ready for production...
|
||||
undoLast: ['Edit/Undo last',
|
||||
{browseMode: function(){
|
||||
return (this.journal && this.journal.length > 0) || 'disabled' }},
|
||||
function(){
|
||||
var journal = this.journal
|
||||
this.rjournal = (this.hasOwnProperty('rjournal')
|
||||
@ -1296,7 +1306,9 @@ module.Journal = core.ImageGridFeatures.Feature({
|
||||
}
|
||||
}
|
||||
}],
|
||||
_redoLast: ['Edit/Redo last',
|
||||
redoLast: ['Edit/Redo last',
|
||||
{browseMode: function(){
|
||||
return (this.rjournal && this.rjournal.length > 0) || 'disabled' }},
|
||||
function(){
|
||||
if(!this.rjournal || this.rjournal.length == 0){
|
||||
return
|
||||
|
||||
@ -798,6 +798,8 @@ module.ViewerActions = actions.Actions({
|
||||
// Zooming is done by multiplying the current scale by .config['zoom-step']
|
||||
// and rounding to nearest discrete number of images to fit on screen.
|
||||
zoomIn: ['Zoom/Zoom in',
|
||||
{browseMode: function(){
|
||||
return Math.min(this.screenwidth, this.screenheight) <= 1 && 'disabled' }},
|
||||
function(){
|
||||
var d = (this.config['zoom-step'] || 1.2)
|
||||
|
||||
@ -811,6 +813,8 @@ module.ViewerActions = actions.Actions({
|
||||
}
|
||||
}],
|
||||
zoomOut: ['Zoom/Zoom out',
|
||||
{browseMode: function(){
|
||||
return this.screenwidth >= this.config['max-screen-images'] && 'disabled' }},
|
||||
function(){
|
||||
var max = this.config['max-screen-images']
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user