symmetrical up/down movement + added stubs for relative aligning ribbons...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2012-07-14 02:26:06 +04:00
parent ef3f107f5e
commit 289d95dc5e

View File

@ -291,7 +291,9 @@ function focusRibbon(direction){
var prev = getImageBefore(id, $('.current-ribbon')[direction]('.ribbon')) var prev = getImageBefore(id, $('.current-ribbon')[direction]('.ribbon'))
if(prev){ if(prev){
var next = prev.next() var next = prev.next()
if(next.length == 0){ // NOTE: direction is accounted for to make the up/down shifts
// symmetrical in the general case...
if(next.length == 0 || direction == 'next'){
prev.click() prev.click()
} else { } else {
next.click() next.click()
@ -314,13 +316,13 @@ function focusBelowRibbon(){
// find an image object after which to position image ID... // find an image object after which to position image ID...
// used for two main tasks: // used for two main tasks:
// - positioning pormoted/demoted images // - positioning promoted/demoted images
// - centering ribbons // - centering ribbons
// returns: // returns:
// - null - empty ribbon or no element greater id should be first // - null - empty ribbon or no element greater id should be first
// - element // - element
// XXX do we need to make ids numbers for this to work? // XXX do we need to make ids numbers for this to work?
// XXX might be better to make this a binary search for very large sets of data // XXX might be better to make this binary search in very large sets of data
function getImageBefore(id, ribbon){ function getImageBefore(id, ribbon){
// walk the ribbon till we find two images one with an ID less and // walk the ribbon till we find two images one with an ID less and
// another greater that id... // another greater that id...
@ -336,6 +338,18 @@ function getImageBefore(id, ribbon){
return prev return prev
} }
// center a ribbon horizontally...
// if id exists in ribbon make it the center, else center between the
// two images that id came from.
function centerRibbonHorizontally(id, ribbon){
// XXX
}
// center the ribbon in the middle of the container vertically...
function centerRibbonVertically(ribbon){
// XXX
}
/********************************************************** Actions **/ /********************************************************** Actions **/