mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 02:40:08 +00:00
some refactoring and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
71af44e6fc
commit
4177be6bed
28
ui/data.js
28
ui/data.js
@ -308,20 +308,20 @@ function loadImages(ref_gid, count, ribbon){
|
|||||||
var old_gids = getImageGIDs(getImageGID(images.first()), images.length, ribbon_i, true)
|
var old_gids = getImageGIDs(getImageGID(images.first()), images.length, ribbon_i, true)
|
||||||
var gids = getImageGIDs(from_gid, count, ribbon_i, true)
|
var gids = getImageGIDs(from_gid, count, ribbon_i, true)
|
||||||
|
|
||||||
// check if heads have common gid and get the diff length...
|
// check if heads have a common gid and get the diff length...
|
||||||
var head = gids.indexOf(old_gids[0]) != -1 ?
|
var i = gids.indexOf(old_gids[0])
|
||||||
gids.indexOf(old_gids[0])
|
var j = old_gids.indexOf(gids[0])
|
||||||
// check if we need to truncate...
|
var head = i != -1 ? i
|
||||||
: old_gids.indexOf(gids[0]) != -1 ?
|
// check if we need to truncate...
|
||||||
-old_gids.indexOf(gids[0])
|
: j != -1 ? -j
|
||||||
: 0
|
: 0
|
||||||
// check if tails have common gid and get the diff length...
|
// check if tails have a common gid and get the diff length...
|
||||||
var tail = gids.indexOf(old_gids[old_gids.length-1]) > 0 ?
|
i = gids.indexOf(old_gids[old_gids.length-1])
|
||||||
gids.length - gids.indexOf(old_gids[old_gids.length-1]) - 1
|
j = old_gids.indexOf(gids[gids.length-1])
|
||||||
// check if we need to truncate...
|
var tail = i > 0 ? gids.length - i - 1
|
||||||
: old_gids.indexOf(gids[gids.length-1]) > 0 ?
|
// check if we need to truncate...
|
||||||
-(old_gids.length - old_gids.indexOf(gids[gids.length-1]) - 1)
|
: j > 0 ? -(old_gids.length - j - 1)
|
||||||
: 0
|
: 0
|
||||||
|
|
||||||
var size = getVisibleImageSize()
|
var size = getVisibleImageSize()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user