Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

swipe fixes for 1.3.5

  • Loading branch information...
commit ea62d87cf2486aa53985c0cdb1e5d75989114442 1 parent 531abac
@davidhellsing davidhellsing authored
Showing with 13 additions and 6 deletions.
  1. +13 −6 src/galleria.js
View
19 src/galleria.js
@@ -2600,7 +2600,7 @@ Galleria.prototype = {
showInfo: true,
showCounter: true,
showImagenav: true,
- swipe: true, // 1.2.4 -> revised in 1.3
+ swipe: 'auto', // 1.2.4 -> revised in 1.3 -> changed type in 1.3.5
thumbCrop: true,
thumbEventType: 'click:fast',
thumbMargin: 0,
@@ -2652,11 +2652,6 @@ Galleria.prototype = {
DUMMY = options.dummy;
}
- // disable swipe if no touch
- if ( !Galleria.TOUCH ) {
- this._options.swipe = false;
- }
-
// hide all content
$( this._target ).children().hide();
@@ -2699,6 +2694,18 @@ Galleria.prototype = {
// merge the theme & caller options
$.extend( true, options, Galleria.theme.defaults, this._original.options, Galleria.configure.options );
+ // internally we use boolean for swipe
+ options.swipe = (function(s) {
+
+ if ( s == 'enforced' ) { return true; }
+
+ // legacy patch
+ if( s === false || s == 'disabled' ) { return false; }
+
+ return !!Galleria.TOUCH;
+
+ }( options.swipe ));
+
// disable options that arent compatible with swipe
if ( options.swipe ) {
options.clicknext = false;
Please sign in to comment.
Something went wrong with that request. Please try again.