updated setBase/focusImage signatures and docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-03-19 21:00:28 +04:00
parent 8dc1590a46
commit a28af7c2ce

View File

@ -72,25 +72,30 @@ var DataPrototype = {
return gid return gid
}, },
// target can be: // This is signature compatible with .getImage(..), see it for more
// image gid // info...
// image order
// ribbon gid
// list
// //
// XXX do we need more specific focus operations like: // XXX do we need more specific focus operations like:
// .focusImage(offset) // .focusImageOffset(offset)
// .focusRibbon(offset) // XXX reference impelementation:
// return this.focusImage('current', offset)
// .focusRibbonOffset(offset)
// XXX reference impelementation:
// var c = this.getRibbonOrder()
// var t = c+offset
// return this.focusImage('current', (t < c ? 'after' : 'before'), t)
focusImage: function(target, mode, list){ focusImage: function(target, mode, list){
var current = this.getImage(target, mode, list) var current = this.getImage(target, mode, list)
if(current != null){ if(this.order.indexOf(current) >= 0){
this.current = current this.current = current
} }
return this return this
}, },
setBase: function(target){ // This is signature compatible with .getRibbon(..), see it for more
var base = this.getRibbon(target) // info...
if(base != null){ setBase: function(target, offset){
var base = this.getRibbon(target, offset)
if(base in this.ribbons){
this.base = base this.base = base
} }
return this return this