added next/prev in order actions...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-10-19 22:32:33 +04:00
parent 5bd0d5bcb5
commit 177e871929
3 changed files with 64 additions and 40 deletions

View File

@ -373,8 +373,14 @@ module.RibbonsPrototype = {
//
// NOTE: if a previous shadow if the same image exists this will recycle
// the existing shadow and cancel it's removal.
// ...this is useful for when a second consecutive action with
// the same image is issued before the previous has time to
// complete, recycling the shadow will enable a single flowing
// animation for such series of commands.
// Example: several fast consecutive horizontal shifts will result
// in a single shadow "flowing" through the ribbon.
// NOTE: multiple shadows of different images are supported...
//
// XXX make this work for multiple targets...
// XXX should we also have a ribbon shadow???
makeShadow: function(target, animate, delay){
delay = delay || 200

View File

@ -128,6 +128,8 @@ module.GLOBAL_KEYBOARD = {
},
ctrl: function(){ a.nextScreen() },
},
'(': function(){ a.prevImageInOrder() },
')': function(){ a.nextImageInOrder() },
Up: {
default: function(){ a.prevRibbon() },
shift: function(){ a.shiftImageUp() },

View File

@ -127,8 +127,8 @@ actions.Actions({
// basic navigation...
//
focusImage: ['Focus image',
function(img){
this.data.focusImage(img)
function(img, list){
this.data.focusImage(img, list)
}],
focusRibbon: ['Focus Ribbon',
function(target){
@ -152,7 +152,7 @@ actions.Actions({
this.focusImage(t, r)
}],
setBaseRibbon: ['',
setBaseRibbon: ['Set base ribbon',
function(target){ this.data.setBase(target) }],
// shorthands for .focusImage(..) and .focusRibbon(..)...
@ -174,6 +174,19 @@ actions.Actions({
this.focusImage('next')
}],
prevImageInOrder: ['Focus previous image in order',
function(){
// keep track of traverse direction...
this.direction = 'left'
this.focusImage('prev', this.data.order)
}],
nextImageInOrder: ['Focus next image in order',
function(){
// keep track of traverse direction...
this.direction = 'right'
this.focusImage('next', this.data.order)
}],
firstRibbon: ['Focus previous ribbon',
function(){ this.focusRibbon('fisrt') }],
lastRibbon: ['Focus next ribbon',
@ -359,24 +372,26 @@ actions.Actions(Client, {
focusImage: [
// XXX skip invisible ribbons (???)
// XXX load data chunks...
function(target){
function(target, list){
var ribbons = this.ribbons
var data = this.data
if(data != null){
var gid = data.getImage(target)
gid = gid == null ? data.getImage('current') : gid
// XXX see if we need to load a new data set...
// XXX
target = ribbons.focusImage(gid)
} else {
if(data == null){
target = ribbons.focusImage(target)
var gid = ribbons.getElemGID(target)
}
return function(){
if(data != null){
// use the data for all the heavy lifting...
// NOTE: this will prevent sync errors...
var gid = data.getImage()
target = ribbons.focusImage(gid)
// XXX see if we need to do some loading...
// XXX
}
// align current ribbon...
ribbons
.centerRibbon(target)
@ -409,8 +424,9 @@ actions.Actions(Client, {
}
}
}
}
}],
setBaseRibbon: ['',
setBaseRibbon: [
function(target){
var r = this.data.getRibbon(target)
r = r == null ? this.ribbons.getRibbon(target) : r