experemental: added scroller.js (not yet working, and disabled)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-06-07 01:36:49 +04:00
parent 5daf97ec88
commit 63c19e5365
2 changed files with 37 additions and 9 deletions

View File

@ -163,8 +163,6 @@ function getRibbonIndex(elem){
// NOTE: if used during an animation/transition this will give the // NOTE: if used during an animation/transition this will give the
// position at the exact frame of the animation, this might not be // position at the exact frame of the animation, this might not be
// the desired "final" data... // the desired "final" data...
// XXX account for rotated images...
// need to keep this generic but still account for rotation...
function getRelativeVisualPosition(outer, inner){ function getRelativeVisualPosition(outer, inner){
outer = $(outer).offset() outer = $(outer).offset()
inner = $(inner).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){ function dblClickHandler(evt){
//setTimeout(toggleSingleImageMode, 100)
toggleSingleImageMode() toggleSingleImageMode()
return false
} }

View File

@ -52,6 +52,7 @@ less = {
<script src="lib/jli.js"></script> <script src="lib/jli.js"></script>
<script src="lib/keyboard.js"></script> <script src="lib/keyboard.js"></script>
<script src="lib/scroller.js"></script>
<script src="base.js"></script> <script src="base.js"></script>
<script src="modes.js"></script> <script src="modes.js"></script>
@ -73,6 +74,8 @@ less = {
//DEBUG = true //DEBUG = true
var SCROLLER_ENABLED = false
// setup... // setup...
$(function(){ $(function(){
// defaults... // defaults...
@ -83,12 +86,36 @@ $(function(){
autoHideCursor($('.viewer')) autoHideCursor($('.viewer'))
// NOTE: this is global so as to not to add any extra complexity to // XXX still buggy...
// the internal workings... if(SCROLLER_ENABLED){
$('.viewer') var scroller = makeScrollHandler($('.viewer'), {
.click(clickHandler) //vScroll: false,
// XXX for some reason this messes up alignment on initial view... //hScroll: false,
//.dblclick(dblClickHandler) 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) $(window)
.resize(function() { .resize(function() {