.forEach(function(gid){ gid = data.getImage(gid) delete data.ribbons[data.getRibbon(gid)][data.order.indexOf(gid)] if(gid == current){ focus = true } })
function(target, mode){ var data = this.data if(data == null){ return } var r = data.getRibbon(target) if(r == null){ return } var c = data.getRibbonOrder() var i = data.getRibbonOrder(r) mode = mode || this.config['ribbon-focus-mode'] || 'order' // NOTE: we are not changing the direction here based on // this.direction as swap will confuse the user... var direction = c < i ? 'before' : 'after' // closest image in order... if(mode == 'order'){ var t = data.getImage(r, direction) // if there are no images in the requied direction, try the // other way... t = t == null ? data.getImage(r, direction == 'before' ? 'after' : 'before') : t // first/last image... } else if(mode == 'first' || mode == 'last'){ var t = data.getImage(mode, r) // unknown mode -- do nothing... } else { return } this.focusImage(t, r) }],