mirror of
https://github.com/flynx/ImageGrid.git
synced 2026-01-09 11:51:09 +00:00
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:
parent
445980802d
commit
0b9dbeb343
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user