mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 10:50:08 +00:00
fixed a couple of bugs in manual sorting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
7fc490e32a
commit
fd96a2ccb6
91
ui/TODO.otl
91
ui/TODO.otl
@ -89,8 +89,8 @@ Roadmap
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
[_] 25% Gen 3 current todo
|
[_] 27% Gen 3 current todo
|
||||||
[_] 51% High priority
|
[_] 54% High priority
|
||||||
[_] BUG: sometimes duplicate images get loaded...
|
[_] BUG: sometimes duplicate images get loaded...
|
||||||
| this happens when jumping back and forth on the mid ribbon until
|
| this happens when jumping back and forth on the mid ribbon until
|
||||||
| the last element shows up and then moving left until the frame
|
| the last element shows up and then moving left until the frame
|
||||||
@ -99,46 +99,21 @@ Roadmap
|
|||||||
|
|
|
|
||||||
| $('[order='+$('.current.image').attr('order')+']').length
|
| $('[order='+$('.current.image').attr('order')+']').length
|
||||||
|
|
|
|
||||||
[_] BUG: aligning still sometimes gets off...
|
|
||||||
| ...after rotating a number of images
|
|
||||||
|
|
|
||||||
| XXX this is likely a side effect of loading duplicates...
|
|
||||||
|
|
|
||||||
| happens when:
|
|
||||||
| - getScreenWidthInImages() < 2
|
|
||||||
| - looking through images in one direction and back, some get misaligned
|
|
||||||
| ...this is stable behaviour by centerRibbon(...),
|
|
||||||
| calling it again will not fix this.
|
|
||||||
| moving next/prev will fix the issue until it comes back again
|
|
||||||
| - affected by LOAD_SCREENS and number of images in ribbon
|
|
||||||
| current figures:
|
|
||||||
| Ribbon: 18
|
|
||||||
| Position going forward: 4
|
|
||||||
| Position going back: 1
|
|
||||||
| LOAD_SCREENS: 6
|
|
||||||
| NOTE: changing LOAD_SCREENS moves the affected positions.
|
|
||||||
| NOTE: had a similar bug where some images still kept their
|
|
||||||
| prior sizing after recycling...
|
|
||||||
| ...check if centerRibbon(...) and correctImageProportionsForRotation(...)
|
|
||||||
| are called in right sequence...
|
|
||||||
[X] BUG: changing window size (F11) in single image modes messes things up...
|
|
||||||
| some images are of different sizes (newly loaded) and aligned in a wrong way...
|
|
||||||
|
|
|
||||||
| appears not to affect square-fit view...
|
|
||||||
|
|
|
||||||
| until we cycle to ribbon mode and back...
|
|
||||||
|
|
|
||||||
| Q: does this trigger the on-resize event???
|
|
||||||
| A: no, not connected...
|
|
||||||
|
|
|
||||||
| possible that this is connected with the align/load bug...
|
|
||||||
|
|
|
||||||
| appears to be a state leak, this affects:
|
|
||||||
| - correctImageProportionsForRotation(image) -- mis-alignes images
|
|
||||||
| while after cycling single image mode, behaves correctly...
|
|
||||||
| - affects finNImages(...) -- uses old size of viewer...
|
|
||||||
[_] BUG: jumping screen images does not load the adjacent ribbons...
|
[_] BUG: jumping screen images does not load the adjacent ribbons...
|
||||||
| positioning is OK but ribbons are not fully visible...
|
| positioning is OK but ribbons are not fully visible...
|
||||||
|
[_] BUG: shifting ribbon left sometimes results in wrong order...
|
||||||
|
| i.e. an image with order 12 before image with order 11
|
||||||
|
|
|
||||||
|
| Example:
|
||||||
|
| - default image set
|
||||||
|
| - move first image 2 positions right
|
||||||
|
|
|
||||||
|
| Resulting state:
|
||||||
|
| - current image order: 12
|
||||||
|
| - next image order: 11
|
||||||
|
| - prev image order: 10
|
||||||
|
|
|
||||||
|
| This is stably reproducible.
|
||||||
[_] ASAP: test on Android...
|
[_] ASAP: test on Android...
|
||||||
[_] 0% Tablet UI
|
[_] 0% Tablet UI
|
||||||
[_] screen buttons
|
[_] screen buttons
|
||||||
@ -214,6 +189,42 @@ Roadmap
|
|||||||
[_] caching config
|
[_] caching config
|
||||||
[_] BUG: BASE_URL seems to gain a new trailing '/' on each save...
|
[_] BUG: BASE_URL seems to gain a new trailing '/' on each save...
|
||||||
| low priority as this does not affect anything...
|
| low priority as this does not affect anything...
|
||||||
|
[X] BUG: changing window size (F11) in single image modes messes things up...
|
||||||
|
| some images are of different sizes (newly loaded) and aligned in a wrong way...
|
||||||
|
|
|
||||||
|
| appears not to affect square-fit view...
|
||||||
|
|
|
||||||
|
| until we cycle to ribbon mode and back...
|
||||||
|
|
|
||||||
|
| Q: does this trigger the on-resize event???
|
||||||
|
| A: no, not connected...
|
||||||
|
|
|
||||||
|
| possible that this is connected with the align/load bug...
|
||||||
|
|
|
||||||
|
| appears to be a state leak, this affects:
|
||||||
|
| - correctImageProportionsForRotation(image) -- mis-alignes images
|
||||||
|
| while after cycling single image mode, behaves correctly...
|
||||||
|
| - affects finNImages(...) -- uses old size of viewer...
|
||||||
|
[X] BUG: aligning still sometimes gets off...
|
||||||
|
| ...after rotating a number of images
|
||||||
|
|
|
||||||
|
| happens when:
|
||||||
|
| - getScreenWidthInImages() < 2
|
||||||
|
| - looking through images in one direction and back, some get misaligned
|
||||||
|
| ...this is stable behaviour by centerRibbon(...),
|
||||||
|
| calling it again will not fix this.
|
||||||
|
| moving next/prev will fix the issue until it comes back again
|
||||||
|
| - affected by LOAD_SCREENS and number of images in ribbon
|
||||||
|
| current figures:
|
||||||
|
| Ribbon: 18
|
||||||
|
| Position going forward: 4
|
||||||
|
| Position going back: 1
|
||||||
|
| LOAD_SCREENS: 6
|
||||||
|
| NOTE: changing LOAD_SCREENS moves the affected positions.
|
||||||
|
| NOTE: had a similar bug where some images still kept their
|
||||||
|
| prior sizing after recycling...
|
||||||
|
| ...check if centerRibbon(...) and correctImageProportionsForRotation(...)
|
||||||
|
| are called in right sequence...
|
||||||
[X] BUG: keyboard.js, some combinations resolve problems...
|
[X] BUG: keyboard.js, some combinations resolve problems...
|
||||||
| in current help shows E, F4, alt-F4 as "Open image in ..."
|
| in current help shows E, F4, alt-F4 as "Open image in ..."
|
||||||
| - E and F4 work OK
|
| - E and F4 work OK
|
||||||
|
|||||||
23
ui/data.js
23
ui/data.js
@ -1475,22 +1475,23 @@ function horizontalShiftImage(image, direction){
|
|||||||
|
|
||||||
// the image we are going to move relative to...
|
// the image we are going to move relative to...
|
||||||
var target = DATA.ribbons[r][ri + (direction == 'next' ? 1 : -1)]
|
var target = DATA.ribbons[r][ri + (direction == 'next' ? 1 : -1)]
|
||||||
|
|
||||||
// we can hit the end or start of the ribbon...
|
// we can hit the end or start of the ribbon...
|
||||||
if(target == null){
|
if(target == null){
|
||||||
return image
|
return image
|
||||||
}
|
}
|
||||||
|
|
||||||
var order = DATA.order
|
// update the order...
|
||||||
var i = order.indexOf(gid)
|
// NOTE: this is a critical section and must be done as fast as possible,
|
||||||
if(i == 0){
|
// this is why we are using the memory to first do the work and
|
||||||
return image
|
// then push it in...
|
||||||
}
|
// NOTE: in a race condition this may still overwrite the order someone
|
||||||
var j = order.indexOf(target)
|
// else is working on, the data will be consistent...
|
||||||
j += (direction == 'next' ? 1 : 0)
|
var order = DATA.order.slice()
|
||||||
|
order.splice(order.indexOf(gid), 1)
|
||||||
order.splice(i, 1)
|
order.splice(order.indexOf(target) + (direction == 'next'? 1 : 0), 0, gid)
|
||||||
order.splice(j, 0, gid)
|
// do the dirty work...
|
||||||
|
DATA.order.splice.apply(DATA.order, [0, DATA.order.length].concat(order))
|
||||||
|
|
||||||
// just update the ribbons, no reloading needed...
|
// just update the ribbons, no reloading needed...
|
||||||
updateRibbonOrder(true)
|
updateRibbonOrder(true)
|
||||||
|
|||||||
@ -160,6 +160,61 @@ var KEYBOARD_CONFIG = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// ribbon mode only...
|
||||||
|
//
|
||||||
|
'.viewer:not(.overlay):not(.single-image-mode)': {
|
||||||
|
title: 'Ribbon mode',
|
||||||
|
|
||||||
|
Left: {
|
||||||
|
alt: doc('Shift image left',
|
||||||
|
function(){
|
||||||
|
event.preventDefault()
|
||||||
|
shiftImageLeft()
|
||||||
|
centerView(null, 'css')
|
||||||
|
// XXX for some odd reason centerRibbons does
|
||||||
|
// something really odd here...
|
||||||
|
//centerRibbons()
|
||||||
|
// XXX HACK...
|
||||||
|
// XXX this still gets misaligned sometimes but this
|
||||||
|
// is likely due to one of the align bugs
|
||||||
|
if(window._center_ribbon_delay != null){
|
||||||
|
clearTimeout(_center_ribbon_delay)
|
||||||
|
}
|
||||||
|
_center_ribbon_delay = setTimeout(
|
||||||
|
function(){
|
||||||
|
centerRibbons()
|
||||||
|
}, 300)
|
||||||
|
|
||||||
|
return false
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
Right: {
|
||||||
|
alt: doc('Shift image right',
|
||||||
|
function(){
|
||||||
|
event.preventDefault()
|
||||||
|
shiftImageRight()
|
||||||
|
centerView(null, 'css')
|
||||||
|
// XXX for some odd reason centerRibbons does
|
||||||
|
// something really odd here...
|
||||||
|
//centerRibbons()
|
||||||
|
// XXX HACK...
|
||||||
|
// XXX this still gets misaligned sometimes but this
|
||||||
|
// is likely due to one of the align bugs
|
||||||
|
// (see: TODO.otl)
|
||||||
|
if(window._center_ribbon_delay != null){
|
||||||
|
clearTimeout(_center_ribbon_delay)
|
||||||
|
}
|
||||||
|
_center_ribbon_delay = setTimeout(
|
||||||
|
function(){
|
||||||
|
centerRibbons()
|
||||||
|
}, 300)
|
||||||
|
|
||||||
|
return false
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
// general setup...
|
// general setup...
|
||||||
//
|
//
|
||||||
'.viewer:not(.overlay)': {
|
'.viewer:not(.overlay)': {
|
||||||
@ -196,25 +251,6 @@ var KEYBOARD_CONFIG = {
|
|||||||
centerRibbons()
|
centerRibbons()
|
||||||
}),
|
}),
|
||||||
ctrl: 'prev-screen',
|
ctrl: 'prev-screen',
|
||||||
alt: doc('Shift image left',
|
|
||||||
function(){
|
|
||||||
event.preventDefault()
|
|
||||||
shiftImageLeft()
|
|
||||||
centerView(null, 'css')
|
|
||||||
// XXX for some odd reason centerRibbons does
|
|
||||||
// something really odd here...
|
|
||||||
//centerRibbons()
|
|
||||||
// XXX HACK...
|
|
||||||
// XXX this still gets misaligned sometimes but this
|
|
||||||
// is likely due to one of the align bugs
|
|
||||||
if(window._center_ribbon_delay != null){
|
|
||||||
clearTimeout(_center_ribbon_delay)
|
|
||||||
}
|
|
||||||
_center_ribbon_delay = setTimeout(
|
|
||||||
function(){
|
|
||||||
centerRibbons()
|
|
||||||
}, 300)
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
Right: {
|
Right: {
|
||||||
default: doc('Next image',
|
default: doc('Next image',
|
||||||
@ -226,26 +262,6 @@ var KEYBOARD_CONFIG = {
|
|||||||
centerRibbons()
|
centerRibbons()
|
||||||
}),
|
}),
|
||||||
ctrl: 'next-screen',
|
ctrl: 'next-screen',
|
||||||
alt: doc('Shift image right',
|
|
||||||
function(){
|
|
||||||
event.preventDefault()
|
|
||||||
shiftImageRight()
|
|
||||||
centerView(null, 'css')
|
|
||||||
// XXX for some odd reason centerRibbons does
|
|
||||||
// something really odd here...
|
|
||||||
//centerRibbons()
|
|
||||||
// XXX HACK...
|
|
||||||
// XXX this still gets misaligned sometimes but this
|
|
||||||
// is likely due to one of the align bugs
|
|
||||||
// (see: TODO.otl)
|
|
||||||
if(window._center_ribbon_delay != null){
|
|
||||||
clearTimeout(_center_ribbon_delay)
|
|
||||||
}
|
|
||||||
_center_ribbon_delay = setTimeout(
|
|
||||||
function(){
|
|
||||||
centerRibbons()
|
|
||||||
}, 300)
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
'prev-screen': doc('Previous screen',
|
'prev-screen': doc('Previous screen',
|
||||||
function(){
|
function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user