From a28af7c2cecbedf2877fb8d78dae7345719c7594 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 19 Mar 2014 21:00:28 +0400 Subject: [PATCH] updated setBase/focusImage signatures and docs... Signed-off-by: Alex A. Naanou --- ui/data4.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/ui/data4.js b/ui/data4.js index 15bbd82c..daf11ba3 100755 --- a/ui/data4.js +++ b/ui/data4.js @@ -72,25 +72,30 @@ var DataPrototype = { return gid }, - // target can be: - // image gid - // image order - // ribbon gid - // list + // This is signature compatible with .getImage(..), see it for more + // info... // // XXX do we need more specific focus operations like: - // .focusImage(offset) - // .focusRibbon(offset) + // .focusImageOffset(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){ var current = this.getImage(target, mode, list) - if(current != null){ + if(this.order.indexOf(current) >= 0){ this.current = current } return this }, - setBase: function(target){ - var base = this.getRibbon(target) - if(base != null){ + // This is signature compatible with .getRibbon(..), see it for more + // info... + setBase: function(target, offset){ + var base = this.getRibbon(target, offset) + if(base in this.ribbons){ this.base = base } return this