mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
mostly fixed broken drag...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
9fceef362d
commit
448099d9e7
@ -165,6 +165,7 @@ var CurrentImageIndicatorActions = actions.Actions({
|
|||||||
updateCurrentImageIndicator: ['- Interface/Update current image indicator',
|
updateCurrentImageIndicator: ['- Interface/Update current image indicator',
|
||||||
function(target, update_border, scale){
|
function(target, update_border, scale){
|
||||||
var ribbon_set = this.ribbons.getRibbonSet()
|
var ribbon_set = this.ribbons.getRibbonSet()
|
||||||
|
var locator = this.ribbons.getRibbonLocator()
|
||||||
|
|
||||||
if(ribbon_set.length == 0){
|
if(ribbon_set.length == 0){
|
||||||
return
|
return
|
||||||
@ -303,17 +304,18 @@ module.CurrentImageIndicator = core.ImageGridFeatures.Feature({
|
|||||||
// only on next/prev screen)...
|
// only on next/prev screen)...
|
||||||
// ...still not sure why .preventTransitions(m) did not
|
// ...still not sure why .preventTransitions(m) did not
|
||||||
// do the job.
|
// do the job.
|
||||||
|
//
|
||||||
|
// XXX BUG: sometimes this is out of sync with ribbon update resulting
|
||||||
|
// in the marker positioned in the wrong spot...
|
||||||
['resizeRibbon.pre',
|
['resizeRibbon.pre',
|
||||||
function(target, s){
|
function(target, s){
|
||||||
var m = this.ribbons.viewer.find('.current-marker')
|
var m = this.ribbons.viewer.find('.current-marker')
|
||||||
// only update if marker exists and we are in current ribbon...
|
// only update if marker exists and we are in current ribbon...
|
||||||
if(m.length != 0 && this.currentRibbon == this.data.getRibbon(target)){
|
if(m.length != 0 && this.currentRibbon == this.data.getRibbon(target)){
|
||||||
//this.ribbons.preventTransitions(m)
|
|
||||||
m.hide()
|
m.hide()
|
||||||
|
|
||||||
return function(){
|
return function(){
|
||||||
this.updateCurrentImageIndicator(target, false)
|
this.updateCurrentImageIndicator(target, false)
|
||||||
//this.ribbons.restoreTransitions(m, true)
|
|
||||||
m
|
m
|
||||||
.show()
|
.show()
|
||||||
// NOTE: keeping display in inline style will
|
// NOTE: keeping display in inline style will
|
||||||
|
|||||||
@ -2043,6 +2043,7 @@ var ControlActions = actions.Actions({
|
|||||||
var d = that.ribbons.dom
|
var d = that.ribbons.dom
|
||||||
var g = evt.gesture
|
var g = evt.gesture
|
||||||
var s = that.scale
|
var s = that.scale
|
||||||
|
var vmin = Math.min(document.body.offsetWidth, document.body.offsetHeight)
|
||||||
|
|
||||||
// we just started...
|
// we just started...
|
||||||
if(!data){
|
if(!data){
|
||||||
@ -2055,7 +2056,7 @@ var ControlActions = actions.Actions({
|
|||||||
// store initial position...
|
// store initial position...
|
||||||
data = {
|
data = {
|
||||||
//left: d.getOffset(this).left,
|
//left: d.getOffset(this).left,
|
||||||
left: $(this).transform('x'),
|
left: parseFloat(($(this).transform('translate3d') || [0])[0])/100 * vmin,
|
||||||
pointers: g.pointers.length,
|
pointers: g.pointers.length,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2072,14 +2073,15 @@ var ControlActions = actions.Actions({
|
|||||||
// queue a render...
|
// queue a render...
|
||||||
render_data[rgid] = {
|
render_data[rgid] = {
|
||||||
ribbon: r,
|
ribbon: r,
|
||||||
x: data.left + (g.deltaX / s),
|
x: ((data.left + (g.deltaX / s)) / vmin * 100) + 'vmin',
|
||||||
}
|
}
|
||||||
|
|
||||||
// inline render...
|
// inline render...
|
||||||
} else {
|
} else {
|
||||||
// do the actual move...
|
// do the actual move...
|
||||||
//d.setOffset(this, data.left + (g.deltaX / s))
|
r.transform({
|
||||||
r.transform({x: data.left + (g.deltaX / s)})
|
x: ((data.left + (g.deltaX / s)) / vmin * 100) + 'vmin',
|
||||||
|
})
|
||||||
|
|
||||||
/* XXX this seems to offer no speed advantages
|
/* XXX this seems to offer no speed advantages
|
||||||
* vs. .setOffset(..) but does not play
|
* vs. .setOffset(..) but does not play
|
||||||
@ -2134,13 +2136,17 @@ var ControlActions = actions.Actions({
|
|||||||
// partly out the left -- show last image...
|
// partly out the left -- show last image...
|
||||||
} else if(cl < 0){
|
} else if(cl < 0){
|
||||||
r.transform({
|
r.transform({
|
||||||
x: r.transform('x') - (cl / s)
|
x: (parseFloat((r.transform('translate3d') || [0])[0])
|
||||||
|
- ((cl / s) / vmin * 100)) + 'vmin'
|
||||||
})
|
})
|
||||||
|
|
||||||
// partly out the right -- show first image...
|
// partly out the right -- show first image...
|
||||||
} else if(cl + (w*s) > W){
|
} else if(cl + (w*s) > W){
|
||||||
r.transform({
|
r.transform({
|
||||||
x: r.transform('x') + (W - (cl + w*s)) / s
|
//x: r.transform('x') + (W - (cl + w*s)) / s
|
||||||
|
// XXX use vmin...
|
||||||
|
x: (parseFloat((r.transform('translate3d') || [0])[0])
|
||||||
|
+ (((W - (cl + w*s)) / s) / vmin * 100)) + 'vmin'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user