Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Correct keyboard and gesture navigation.

Fixes #97
  • Loading branch information...
commit 4f67a5452b5bbbb6daf698ee61365f443bca55cc 1 parent 7383d91
Michael Sisk authored
Showing with 10 additions and 3 deletions.
  1. +8 −1 -/js/dynamic.js
  2. +1 −1  -/js/gestures.js
  3. +1 −1  -/js/shortcuts.js
View
9 -/js/dynamic.js
@@ -45,4 +45,11 @@ jQuery( function( $ ) {
history.pushState( { webcomic: true, url: url, container: container }, '', container ? window.location.href : url );
} );
}
-} );
+} );
+
+/** Ensure that keyboard shortcuts and gestures work with dynamic navigation. */
+(function( $ ) {
+ $.fn.webcomicDynamicNavigation = function() {
+ return true;
+ }
+} )(jQuery);
View
2  -/js/gestures.js
@@ -72,7 +72,7 @@ jQuery( function( $ ) {
if ( $e && $e.length ) {
e.preventDefault();
- if ( $e.closest( '[data-webcomic-container]' ).length ) {
+ if ( $.fn.webcomicDynamicNavigation && $e.closest( '[data-webcomic-container]' ).length ) {
$e.trigger( 'click' );
} else {
window.location.href = $e.attr( 'href' );
View
2  -/js/shortcuts.js
@@ -10,7 +10,7 @@ jQuery( function( $ ) {
}
if ( $e.length ) {
- if ( $e.closest( '[data-webcomic-container]' ).length ) {
+ if ( $.fn.webcomicDynamicNavigation && $e.closest( '[data-webcomic-container]' ).length ) {
$e.trigger( 'click' );
} else {
window.location.href = $e.attr( 'href' );
Please sign in to comment.
Something went wrong with that request. Please try again.