diff --git a/ui (gen4)/css/layout.less b/ui (gen4)/css/layout.less index d4a5ad5d..59f1b582 100755 --- a/ui (gen4)/css/layout.less +++ b/ui (gen4)/css/layout.less @@ -572,12 +572,6 @@ stretching in width... */ .ribbon:empty { display: none; } -.ribbon:first-child { - margin-top: 0; -} -.ribbon:last-child { - margin-bottom: 0; -} .base-ribbon-marker { position: absolute; diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index 6c48870f..7397ad6c 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -43,7 +43,7 @@ function(force, callback){ var updateImagePosition = module.updateImagePosition = function updateImagePosition(actions, target){ - var s = actions.ribbons.getRibbonSet() + var s = actions.ribbons.getRibbonLocator() if(s.length == 0){ return @@ -90,7 +90,8 @@ function updateImagePosition(actions, target){ to = actions.data.getRibbon(target) if(actions.ribbons.getRibbon(to).length == 0){ - actions.ribbons.placeRibbon(to, actions.data.getRibbonOrder(target)) + actions.ribbons + .placeRibbon(to, actions.data.getRibbonOrder(target)) } actions.ribbons.placeImage(target, to) diff --git a/ui (gen4)/imagegrid/ribbons.js b/ui (gen4)/imagegrid/ribbons.js index 8a4ea48a..af588211 100755 --- a/ui (gen4)/imagegrid/ribbons.js +++ b/ui (gen4)/imagegrid/ribbons.js @@ -515,6 +515,9 @@ var RibbonsPrototype = { return this }, + + // XXX add angle... + // XXX // Get visible image tile size... // @@ -1030,7 +1033,7 @@ var RibbonsPrototype = { // gid... } else if(typeof(target) == typeof('str')){ //return this.viewer.find('.ribbon[gid="'+JSON.stringify(target)+'"]') - var r = this.viewer.find('.ribbon[gid='+JSON.stringify(target)+']') + var r = this.viewer.find('.ribbon[gid='+JSON.stringify(target)+']:not(.clone)') // if no ribbon is found, try and get an image and it's ribbon... return r.length == 0 ? this.getImage(target).parents('.ribbon').first() @@ -1105,6 +1108,7 @@ var RibbonsPrototype = { ribbon_set.append(ribbon) } else if(i == -1 || i > position) { + // XXX need to compensate for offset??? ribbons.eq(position).before(ribbon) // for placing after need to account for target ribbon removal... @@ -2185,9 +2189,16 @@ var RibbonsPrototype = { }, // center a ribbon vertically... + // + // Center current ribbon... + // .centerRibbon() + // -> Ribbons + // + // Center specific ribbon... + // .centerRibbon(image) + // .centerRibbon(ribbon) + // -> Ribbons // - // XXX custom align point woud also be nice... - // (top, bottom, center, %, px) centerRibbon: function(target){ var ribbon = this.getRibbon(target) var locator = this.getRibbonLocator() @@ -2207,8 +2218,20 @@ var RibbonsPrototype = { // center an image horizontally... // - // XXX custom align point would also be nice... - // (top, bottom, center, %, px) + // Center current ribbon/image... + // .centerImage() + // -> Ribbons + // + // Center specific image... + // .centerImage(image) + // .centerImage(image, 'center') + // -> Ribbons + // + // Center ribbon before/after an image... + // .centerImage(image, 'before') + // .centerImage(image, 'after') + // -> Ribbons + // centerImage: function(target, mode){ target = this.getImage(target) var ribbon = this.getRibbon(target)