mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-17 08:41:40 +00:00
added ribbon align for prev and next ribbons...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
12852e10a7
commit
d51f567a15
@ -93,7 +93,21 @@ function setCurrentImage(){
|
|||||||
centerSquare()
|
centerSquare()
|
||||||
|
|
||||||
// center other ribbons relative to current image...
|
// center other ribbons relative to current image...
|
||||||
// XXX
|
// XXX only two ribbons are positioned at this point...
|
||||||
|
var id = $('.current.image').attr('id')
|
||||||
|
var directions = ['prev', 'next']
|
||||||
|
for(var i in directions){
|
||||||
|
var ribbon = $('.current.ribbon')[directions[i]]('.ribbon')
|
||||||
|
if(ribbon.length == 1){
|
||||||
|
var img = getImageBefore(id, ribbon)
|
||||||
|
if(img != null){
|
||||||
|
alignRibbon(img, 'before')
|
||||||
|
} else {
|
||||||
|
// there are no images before...
|
||||||
|
alignRibbon(ribbon.children('.image').first(), 'after')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -134,6 +148,7 @@ function handleImageClick(e) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// this sets the zooming factor used in manual zooming...
|
||||||
var ZOOM_FACTOR = 2
|
var ZOOM_FACTOR = 2
|
||||||
|
|
||||||
// key configuration...
|
// key configuration...
|
||||||
|
|||||||
4
ui/ui.js
4
ui/ui.js
@ -121,13 +121,13 @@ function alignRibbon(image, position){
|
|||||||
|
|
||||||
switch(position){
|
switch(position){
|
||||||
case 'before':
|
case 'before':
|
||||||
ribbon.css({'margin-left': h_offset + w/2})
|
ribbon.css({'margin-left': h_offset - w/2})
|
||||||
return true
|
return true
|
||||||
case 'center':
|
case 'center':
|
||||||
ribbon.css({'margin-left': h_offset})
|
ribbon.css({'margin-left': h_offset})
|
||||||
return true
|
return true
|
||||||
case 'after':
|
case 'after':
|
||||||
ribbon.css({'margin-left': h_offset - w/2})
|
ribbon.css({'margin-left': h_offset + w/2})
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user