extendRibbon now done (correctly accounts for left add/remove), loadImages still broken...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-05-13 17:59:19 +04:00
parent 445980802d
commit 0b9dbeb343

View File

@ -330,16 +330,25 @@ function extendRibbon(left, right, ribbon){
// normalize position... // normalize position...
// NOTE: this is fool-proof as it's based on relative visual // NOTE: this is fool-proof as it's based on relative visual
// position... // position...
var position_updated = false
var post = getRelativeVisualPosition($('.viewer'), ribbon).left var post = getRelativeVisualPosition($('.viewer'), ribbon).left
var scale = getElementScale($('.ribbon-set'))
var l = parseFloat(ribbon.css('left'))
l = isNaN(l) ? 0 : l
if(pre != post){ if(pre != post){
var scale = getElementScale($('.ribbon-set')) position_updated = true
var l = parseFloat(ribbon.css('left')) l = l + (pre - post)/scale
l = isNaN(l) ? 0 : l }
if(left != 0){
position_updated = true
l -= left * images.outerWidth()
}
if(position_updated){
// XXX do not do this unless l is changed...
ribbon.css({ ribbon.css({
left: l + (pre - post)/scale, left: l,
}) })
} }
// compensate for the truncation...
return res return res
} }