mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
experemental: added scroller.js (not yet working, and disabled)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
5daf97ec88
commit
63c19e5365
@ -163,8 +163,6 @@ function getRibbonIndex(elem){
|
||||
// NOTE: if used during an animation/transition this will give the
|
||||
// position at the exact frame of the animation, this might not be
|
||||
// the desired "final" data...
|
||||
// XXX account for rotated images...
|
||||
// need to keep this generic but still account for rotation...
|
||||
function getRelativeVisualPosition(outer, inner){
|
||||
outer = $(outer).offset()
|
||||
inner = $(inner).offset()
|
||||
@ -669,9 +667,12 @@ function clickHandler(evt){
|
||||
}
|
||||
|
||||
|
||||
// XXX for some reason this messes up alignment for the initial view...
|
||||
// XXX this does not work correctly because it also generates two clicks,
|
||||
// and this messes things up...
|
||||
function dblClickHandler(evt){
|
||||
//setTimeout(toggleSingleImageMode, 100)
|
||||
toggleSingleImageMode()
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ less = {
|
||||
|
||||
<script src="lib/jli.js"></script>
|
||||
<script src="lib/keyboard.js"></script>
|
||||
<script src="lib/scroller.js"></script>
|
||||
|
||||
<script src="base.js"></script>
|
||||
<script src="modes.js"></script>
|
||||
@ -73,6 +74,8 @@ less = {
|
||||
|
||||
//DEBUG = true
|
||||
|
||||
var SCROLLER_ENABLED = false
|
||||
|
||||
// setup...
|
||||
$(function(){
|
||||
// defaults...
|
||||
@ -83,12 +86,36 @@ $(function(){
|
||||
|
||||
autoHideCursor($('.viewer'))
|
||||
|
||||
// NOTE: this is global so as to not to add any extra complexity to
|
||||
// the internal workings...
|
||||
$('.viewer')
|
||||
.click(clickHandler)
|
||||
// XXX for some reason this messes up alignment on initial view...
|
||||
//.dblclick(dblClickHandler)
|
||||
// XXX still buggy...
|
||||
if(SCROLLER_ENABLED){
|
||||
var scroller = makeScrollHandler($('.viewer'), {
|
||||
//vScroll: false,
|
||||
//hScroll: false,
|
||||
scrollDisabled: true,
|
||||
|
||||
//enableMultiClicks: true,
|
||||
// XXX does not seem to work...
|
||||
//multiClickTimeout: 100,
|
||||
|
||||
transitionDuration: 100,
|
||||
transitionEasing: 'liner',
|
||||
})
|
||||
.start()
|
||||
|
||||
$('.viewer')
|
||||
.on('shortClick', function(){ clickHandler(event) })
|
||||
//.on('doubleClick', dblClickHandler)
|
||||
.on('longClick', dblClickHandler)
|
||||
//.on('longClick', function(){ toggleImageMark() })
|
||||
|
||||
} else {
|
||||
// NOTE: this is global so as to not to add any extra complexity to
|
||||
// the internal workings...
|
||||
$('.viewer')
|
||||
// XXX this messes things up...
|
||||
//.dblclick(dblClickHandler)
|
||||
.click(clickHandler)
|
||||
}
|
||||
|
||||
$(window)
|
||||
.resize(function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user