mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-27 13:32:01 +00:00
minor tweeks, still data-binding buggy -- problems loading section while sorting/shifting/moving, needs more tweeking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6bbd404386
commit
62ee92dc81
@ -642,10 +642,15 @@ function centerRibbon(ribbon, image, mode){
|
||||
|
||||
|
||||
// a shorthand...
|
||||
function centerRibbons(mode){
|
||||
function centerRibbons(mode, no_skip_current){
|
||||
return $('.ribbon')
|
||||
.filter(':visible')
|
||||
.each(function(){ centerRibbon($(this), null, mode) })
|
||||
.each(function(){
|
||||
if(no_skip_current == true && $(this).find('.current.image').length > 0){
|
||||
return
|
||||
}
|
||||
centerRibbon($(this), null, mode)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
17
ui/data.js
17
ui/data.js
@ -245,8 +245,10 @@ function updateImage(image, gid, size){
|
||||
}
|
||||
|
||||
// select best preview by size...
|
||||
var url, s
|
||||
var preview_size = "0px"
|
||||
// NOTE: this will use the original if everything else is smaller...
|
||||
var s
|
||||
var url = 'url('+DATA.images[gid].path+')'
|
||||
var preview_size = 'Original'
|
||||
var p = Infinity
|
||||
for(var k in img_data.preview){
|
||||
s = parseInt(k)
|
||||
@ -256,14 +258,9 @@ function updateImage(image, gid, size){
|
||||
url = 'url('+ img_data.preview[k] +')'
|
||||
}
|
||||
}
|
||||
// if no preview found use the original...
|
||||
if(url == null){
|
||||
preview_size = 'Original'
|
||||
url = 'url('+DATA.images[gid].path+')'
|
||||
}
|
||||
image.css({
|
||||
'background-image': url,
|
||||
})
|
||||
'background-image': url,
|
||||
})
|
||||
|
||||
window.DEBUG && image.html(DATA.order.indexOf(gid) +'<br>'+ gid +'<br>'+ preview_size)
|
||||
|
||||
@ -419,7 +416,7 @@ function convertDataGen1(data){
|
||||
var images = res.images
|
||||
var order = res.order
|
||||
var _dateSort = function(a, b){
|
||||
return Math.round(images[a].ctime - images[b].ctime)
|
||||
return images[b].ctime - images[a].ctime
|
||||
}
|
||||
|
||||
// position...
|
||||
|
||||
@ -258,6 +258,7 @@ body {
|
||||
|
||||
DEBUG = true
|
||||
|
||||
|
||||
// setup...
|
||||
$(function(){
|
||||
|
||||
@ -275,7 +276,9 @@ $(function(){
|
||||
$(document)
|
||||
.keydown(makeKeyboardHandler(
|
||||
KEYBOARD_CONFIG,
|
||||
function(k){console.log(k)}))
|
||||
function(k){
|
||||
window.DEBUG && console.log(k)
|
||||
}))
|
||||
|
||||
setupDataBindings()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user