mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-28 18:50:08 +00:00
added hammer.js, still in test mode...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a5667eba7c
commit
1f352ff5da
9
ext-lib/hammer.min.js
vendored
Executable file
9
ext-lib/hammer.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
1
ext-lib/hammer.min.map
Executable file
1
ext-lib/hammer.min.map
Executable file
File diff suppressed because one or more lines are too long
35
index.html
35
index.html
@ -93,6 +93,8 @@
|
||||
<script src="ext-lib/iscroll.js"></script>
|
||||
<script src="ext-lib/iscroll-zoom.js"></script>
|
||||
|
||||
<script src="ext-lib/hammer.min.js"></script>
|
||||
|
||||
<script src="lib/jli.js"></script>
|
||||
<script src="lib/scroller.js"></script>
|
||||
<script src="lib/keyboard.js"></script>
|
||||
@ -378,7 +380,8 @@ $(function(){
|
||||
.keydown(makeKeyboardHandler(KEYBOARD_CONFIG))
|
||||
|
||||
window.MagazineScroller = new IScroll('.viewer', {
|
||||
tap: true,
|
||||
//tap: true,
|
||||
tap: false,
|
||||
|
||||
scrollX: true,
|
||||
scrollY: false,
|
||||
@ -398,19 +401,47 @@ $(function(){
|
||||
|
||||
window.MULTI_FINGER_RELEASE_TIMEOUT = 50
|
||||
|
||||
var hammertime = Hammer($('.magazine')[0], {
|
||||
tapAlways: false,
|
||||
})
|
||||
|
||||
$('.magazine')
|
||||
.on('hold', function(){
|
||||
var target = $(event.target)
|
||||
setTimeout(function(){
|
||||
if(!target.hasClass('current') && target.parents('.current.page').length == 0){
|
||||
focusPage(target)
|
||||
}
|
||||
togglePageView()
|
||||
}, 0)
|
||||
})
|
||||
// XXX not working correctly yet...
|
||||
/*
|
||||
.on('doubletap', function(){
|
||||
setTimeout(function(){
|
||||
if(togglePageView('?') != 'on'){
|
||||
togglePageView('on')
|
||||
}
|
||||
}, 0)
|
||||
})
|
||||
*/
|
||||
.on('tap', function(){
|
||||
var target = $(event.target)
|
||||
|
||||
setTimeout(function(){
|
||||
// trigger this ONLY if no page change has happened...
|
||||
if(target.hasClass('current') || target.parents('.current.page').length != 0){
|
||||
handleCaption(target)
|
||||
|
||||
}
|
||||
|
||||
// focus the page...
|
||||
focusPage(target, togglePageView('?') == 'on' ? 'auto' : 'center')
|
||||
}, 0)
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
$('.viewer')
|
||||
.on('touchstart', function(){
|
||||
// This is here to recover from touching a finger after
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user