mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +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()
|
||||
|
||||
// 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
|
||||
|
||||
// key configuration...
|
||||
|
||||
4
ui/ui.js
4
ui/ui.js
@ -121,13 +121,13 @@ function alignRibbon(image, position){
|
||||
|
||||
switch(position){
|
||||
case 'before':
|
||||
ribbon.css({'margin-left': h_offset + w/2})
|
||||
ribbon.css({'margin-left': h_offset - w/2})
|
||||
return true
|
||||
case 'center':
|
||||
ribbon.css({'margin-left': h_offset})
|
||||
return true
|
||||
case 'after':
|
||||
ribbon.css({'margin-left': h_offset - w/2})
|
||||
ribbon.css({'margin-left': h_offset + w/2})
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user