cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-01-01 07:58:55 +03:00
parent 045030eecb
commit 2e19c02b0c

View File

@ -106,8 +106,7 @@ actions.Actions({
// XXX // XXX
get version(){ get version(){
return this.config.version return this.config.version },
},
// basic state... // basic state...
// NOTE: the setters in the following use the appropriate actions // NOTE: the setters in the following use the appropriate actions
@ -124,27 +123,21 @@ actions.Actions({
// Base ribbon... // Base ribbon...
get base(){ get base(){
return this.data.base return this.data.base },
},
set base(value){ set base(value){
this.setBaseRibbon(value) this.setBaseRibbon(value) },
},
// Current image... // Current image...
get current(){ get current(){
return this.data.current return this.data.current },
},
set current(value){ set current(value){
this.focusImage(value) this.focusImage(value) },
},
// Current ribbon... // Current ribbon...
get current_ribbon(){ get current_ribbon(){
return this.data.getRibbon() return this.data.getRibbon() },
},
set current_ribbon(value){ set current_ribbon(value){
this.focusRibbon(value) this.focusRibbon(value) },
},
// Default direction... // Default direction...
// //
@ -568,11 +561,13 @@ actions.Actions({
// XXX .undoLast(..) on these for some reason skips... // XXX .undoLast(..) on these for some reason skips...
// ...e.g. two shifts are undone with three calls to .undoLast()... // ...e.g. two shifts are undone with three calls to .undoLast()...
shiftImageUpNewRibbon: ['Edit|Ribbon/Shift image up to a new empty ribbon', shiftImageUpNewRibbon: ['Edit|Ribbon/Shift image up to a new empty ribbon',
{journal: true},
function(target){ function(target){
this.data.newRibbon(target) this.data.newRibbon(target)
this.shiftImageUp(target) this.shiftImageUp(target)
}], }],
shiftImageDownNewRibbon: ['Edit|Ribbon/Shift image down to a new empty ribbon', shiftImageDownNewRibbon: ['Edit|Ribbon/Shift image down to a new empty ribbon',
{journal: true},
function(target){ function(target){
this.data.newRibbon(target, 'below') this.data.newRibbon(target, 'below')
this.shiftImageDown(target) this.shiftImageDown(target)
@ -680,7 +675,9 @@ actions.Actions({
// //
// //
// NOTE: target must be .data.getImage(..) compatible, see it for docs... // NOTE: target must be .data.getImage(..) compatible, see it for docs...
// XXX correct undo???
rotate: ['- Image|Edit/Rotate image', rotate: ['- Image|Edit/Rotate image',
{journal: true},
function(target, direction){ function(target, direction){
if(arguments.length == 0){ if(arguments.length == 0){
return this.image && this.image.orientation || 0 return this.image && this.image.orientation || 0
@ -693,6 +690,7 @@ actions.Actions({
&& this.images.rotateImage(this.data.getImage(target), direction || 'cw') && this.images.rotateImage(this.data.getImage(target), direction || 'cw')
}], }],
flip: ['- Image|Edit/Flip image', flip: ['- Image|Edit/Flip image',
{journal: true},
function(target, direction){ function(target, direction){
if(target == 'vertical' || target == 'horizontal'){ if(target == 'vertical' || target == 'horizontal'){
direction = target direction = target
@ -726,8 +724,7 @@ actions.Actions({
alignToRibbon: ['Ribbon|Edit/Align top ribbon to base', alignToRibbon: ['Ribbon|Edit/Align top ribbon to base',
{journal: true}, {journal: true},
function(target, start, end){ function(target, start, end){
this.data = this.data.alignToRibbon(target, start, end) this.data = this.data.alignToRibbon(target, start, end) }],
}],
}) })