materialize-sass 0.95.3.2 → 0.95.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +59 -59
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Bold.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
- data/app/assets/javascripts/materialize-sprockets.js +1 -1
- data/app/assets/javascripts/materialize.js +1 -0
- data/app/assets/javascripts/materialize/{animations.js → animation.js} +1 -0
- data/app/assets/javascripts/materialize/buttons.js +20 -20
- data/app/assets/javascripts/materialize/cards.js +11 -7
- data/app/assets/javascripts/materialize/collapsible.js +1 -1
- data/app/assets/javascripts/materialize/date_picker/picker.date.js +27 -24
- data/app/assets/javascripts/materialize/dropdown.js +17 -15
- data/app/assets/javascripts/materialize/forms.js +41 -19
- data/app/assets/javascripts/materialize/hammer.min.js +1 -1
- data/app/assets/javascripts/materialize/init.js +4 -4
- data/app/assets/javascripts/materialize/jquery.easing.1.3.js +1 -1
- data/app/assets/javascripts/materialize/leanModal.js +68 -23
- data/app/assets/javascripts/materialize/materialbox.js +22 -10
- data/app/assets/javascripts/materialize/parallax.js +10 -1
- data/app/assets/javascripts/materialize/pushpin.js +1 -13
- data/app/assets/javascripts/materialize/scrollFire.js +11 -10
- data/app/assets/javascripts/materialize/scrollspy.js +1 -1
- data/app/assets/javascripts/materialize/sideNav.js +42 -38
- data/app/assets/javascripts/materialize/slider.js +2 -3
- data/app/assets/javascripts/materialize/tabs.js +1 -2
- data/app/assets/javascripts/materialize/tooltip.js +0 -1
- data/app/assets/javascripts/materialize/transitions.js +60 -5
- data/app/assets/javascripts/materialize/velocity.min.js +3 -3
- data/app/assets/stylesheets/materialize/components/_buttons.scss +142 -140
- data/app/assets/stylesheets/materialize/components/_dropdown.scss +1 -0
- data/app/assets/stylesheets/materialize/components/_global.scss +3 -3
- data/app/assets/stylesheets/materialize/components/_grid.scss +2 -2
- data/app/assets/stylesheets/materialize/components/_icons-material-design.scss +5 -5
- data/app/assets/stylesheets/materialize/components/_modal.scss +13 -0
- data/app/assets/stylesheets/materialize/components/_navbar.scss +15 -21
- data/app/assets/stylesheets/materialize/components/_preloader.scss +20 -24
- data/app/assets/stylesheets/materialize/components/_roboto.scss +15 -5
- data/app/assets/stylesheets/materialize/components/_sideNav.scss +1 -0
- data/app/assets/stylesheets/materialize/components/_slider.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_tabs.scss +43 -43
- data/app/assets/stylesheets/materialize/components/_typography.scss +55 -55
- data/app/assets/stylesheets/materialize/components/_variables.scss +11 -11
- data/app/assets/stylesheets/materialize/components/_waves.scss +2 -3
- data/lib/materialize-sass/version.rb +1 -1
- metadata +27 -8
- checksums.yaml +0 -7
@@ -1 +1 @@
|
|
1
|
-
!function(a,b,c,d){"use strict";function k(a,b,c){return setTimeout(q(a,c),b)}function l(a,b,c){return Array.isArray(a)?(m(a,c[b],c),!0):!1}function m(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function n(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}function o(a,b){return n(a,b,!0)}function p(a,b,c){var e,d=b.prototype;e=a.prototype=Object.create(d),e.constructor=a,e._super=d,c&&n(e,c)}function q(a,b){return function(){return a.apply(b,arguments)}}function r(a,b){return typeof a==g?a.apply(b?b[0]||d:d,b):a}function s(a,b){return a===d?b:a}function t(a,b,c){m(x(b),function(b){a.addEventListener(b,c,!1)})}function u(a,b,c){m(x(b),function(b){a.removeEventListener(b,c,!1)})}function v(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function w(a,b){return a.indexOf(b)>-1}function x(a){return a.trim().split(/\s+/g)}function y(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function z(a){return Array.prototype.slice.call(a,0)}function A(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];y(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function B(a,b){for(var c,f,g=b[0].toUpperCase()+b.slice(1),h=0;h<e.length;){if(c=e[h],f=c?c+g:b,f in a)return f;h++}return d}function D(){return C++}function E(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function ab(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){r(a.options.enable,[a])&&c.handler(b)},this.init()}function bb(a){var b,c=a.options.inputClass;return b=c?c:H?wb:I?Eb:G?Gb:rb,new b(a,cb)}function cb(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&O&&0===d-e,g=b&(Q|R)&&0===d-e;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,db(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function db(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=gb(b)),e>1&&!c.firstMultiple?c.firstMultiple=gb(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=hb(d);b.timeStamp=j(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=lb(h,i),b.distance=kb(h,i),eb(c,b),b.offsetDirection=jb(b.deltaX,b.deltaY),b.scale=g?nb(g.pointers,d):1,b.rotation=g?mb(g.pointers,d):0,fb(c,b);var k=a.element;v(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function eb(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===O||f.eventType===Q)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function fb(a,b){var f,g,h,j,c=a.lastInterval||b,e=b.timeStamp-c.timeStamp;if(b.eventType!=R&&(e>N||c.velocity===d)){var k=c.deltaX-b.deltaX,l=c.deltaY-b.deltaY,m=ib(e,k,l);g=m.x,h=m.y,f=i(m.x)>i(m.y)?m.x:m.y,j=jb(k,l),a.lastInterval=b}else f=c.velocity,g=c.velocityX,h=c.velocityY,j=c.direction;b.velocity=f,b.velocityX=g,b.velocityY=h,b.direction=j}function gb(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:h(a.pointers[c].clientX),clientY:h(a.pointers[c].clientY)},c++;return{timeStamp:j(),pointers:b,center:hb(b),deltaX:a.deltaX,deltaY:a.deltaY}}function hb(a){var b=a.length;if(1===b)return{x:h(a[0].clientX),y:h(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:h(c/b),y:h(d/b)}}function ib(a,b,c){return{x:b/a||0,y:c/a||0}}function jb(a,b){return a===b?S:i(a)>=i(b)?a>0?T:U:b>0?V:W}function kb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function lb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function mb(a,b){return lb(b[1],b[0],_)-lb(a[1],a[0],_)}function nb(a,b){return kb(b[0],b[1],_)/kb(a[0],a[1],_)}function rb(){this.evEl=pb,this.evWin=qb,this.allow=!0,this.pressed=!1,ab.apply(this,arguments)}function wb(){this.evEl=ub,this.evWin=vb,ab.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Ab(){this.evTarget=yb,this.evWin=zb,this.started=!1,ab.apply(this,arguments)}function Bb(a,b){var c=z(a.touches),d=z(a.changedTouches);return b&(Q|R)&&(c=A(c.concat(d),"identifier",!0)),[c,d]}function Eb(){this.evTarget=Db,this.targetIds={},ab.apply(this,arguments)}function Fb(a,b){var c=z(a.touches),d=this.targetIds;if(b&(O|P)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=z(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return v(a.target,i)}),b===O)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Q|R)&&delete d[g[e].identifier],e++;return h.length?[A(f.concat(h),"identifier",!0),h]:void 0}function Gb(){ab.apply(this,arguments);var a=q(this.handler,this);this.touch=new Eb(this.manager,a),this.mouse=new rb(this.manager,a)}function Pb(a,b){this.manager=a,this.set(b)}function Qb(a){if(w(a,Mb))return Mb;var b=w(a,Nb),c=w(a,Ob);return b&&c?Nb+" "+Ob:b||c?b?Nb:Ob:w(a,Lb)?Lb:Kb}function Yb(a){this.id=D(),this.manager=null,this.options=o(a||{},this.defaults),this.options.enable=s(this.options.enable,!0),this.state=Rb,this.simultaneous={},this.requireFail=[]}function Zb(a){return a&Wb?"cancel":a&Ub?"end":a&Tb?"move":a&Sb?"start":""}function $b(a){return a==W?"down":a==V?"up":a==T?"left":a==U?"right":""}function _b(a,b){var c=b.manager;return c?c.get(a):a}function ac(){Yb.apply(this,arguments)}function bc(){ac.apply(this,arguments),this.pX=null,this.pY=null}function cc(){ac.apply(this,arguments)}function dc(){Yb.apply(this,arguments),this._timer=null,this._input=null}function ec(){ac.apply(this,arguments)}function fc(){ac.apply(this,arguments)}function gc(){Yb.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function hc(a,b){return b=b||{},b.recognizers=s(b.recognizers,hc.defaults.preset),new kc(a,b)}function kc(a,b){b=b||{},this.options=o(b,hc.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=bb(this),this.touchAction=new Pb(this,this.options.touchAction),lc(this,!0),m(b.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function lc(a,b){var c=a.element;m(a.options.cssProps,function(a,d){c.style[B(c.style,d)]=b?a:""})}function mc(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var e=["","webkit","moz","MS","ms","o"],f=b.createElement("div"),g="function",h=Math.round,i=Math.abs,j=Date.now,C=1,F=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in a,H=B(a,"PointerEvent")!==d,I=G&&F.test(navigator.userAgent),J="touch",K="pen",L="mouse",M="kinect",N=25,O=1,P=2,Q=4,R=8,S=1,T=2,U=4,V=8,W=16,X=T|U,Y=V|W,Z=X|Y,$=["x","y"],_=["clientX","clientY"];ab.prototype={handler:function(){},init:function(){this.evEl&&t(this.element,this.evEl,this.domHandler),this.evTarget&&t(this.target,this.evTarget,this.domHandler),this.evWin&&t(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&u(this.element,this.evEl,this.domHandler),this.evTarget&&u(this.target,this.evTarget,this.domHandler),this.evWin&&u(E(this.element),this.evWin,this.domHandler)}};var ob={mousedown:O,mousemove:P,mouseup:Q},pb="mousedown",qb="mousemove mouseup";p(rb,ab,{handler:function(a){var b=ob[a.type];b&O&&0===a.button&&(this.pressed=!0),b&P&&1!==a.which&&(b=Q),this.pressed&&this.allow&&(b&Q&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:L,srcEvent:a}))}});var sb={pointerdown:O,pointermove:P,pointerup:Q,pointercancel:R,pointerout:R},tb={2:J,3:K,4:L,5:M},ub="pointerdown",vb="pointermove pointerup pointercancel";a.MSPointerEvent&&(ub="MSPointerDown",vb="MSPointerMove MSPointerUp MSPointerCancel"),p(wb,ab,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=sb[d],f=tb[a.pointerType]||a.pointerType,g=f==J,h=y(b,a.pointerId,"pointerId");e&O&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Q|R)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var xb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},yb="touchstart",zb="touchstart touchmove touchend touchcancel";p(Ab,ab,{handler:function(a){var b=xb[a.type];if(b===O&&(this.started=!0),this.started){var c=Bb.call(this,a,b);b&(Q|R)&&0===c[0].length-c[1].length&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}});var Cb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},Db="touchstart touchmove touchend touchcancel";p(Eb,ab,{handler:function(a){var b=Cb[a.type],c=Fb.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}),p(Gb,ab,{handler:function(a,b,c){var d=c.pointerType==J,e=c.pointerType==L;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Q|R)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Hb=B(f.style,"touchAction"),Ib=Hb!==d,Jb="compute",Kb="auto",Lb="manipulation",Mb="none",Nb="pan-x",Ob="pan-y";Pb.prototype={set:function(a){a==Jb&&(a=this.compute()),Ib&&(this.manager.element.style[Hb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return m(this.manager.recognizers,function(b){r(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),Qb(a.join(" "))},preventDefaults:function(a){if(!Ib){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return b.preventDefault(),void 0;var d=this.actions,e=w(d,Mb),f=w(d,Ob),g=w(d,Nb);return e||f&&c&X||g&&c&Y?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var Rb=1,Sb=2,Tb=4,Ub=8,Vb=Ub,Wb=16,Xb=32;Yb.prototype={defaults:{},set:function(a){return n(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(l(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_b(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return l(a,"dropRecognizeWith",this)?this:(a=_b(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(l(a,"requireFailure",this))return this;var b=this.requireFail;return a=_b(a,this),-1===y(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(l(a,"dropRequireFailure",this))return this;a=_b(a,this);var b=y(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function d(d){b.manager.emit(b.options.event+(d?Zb(c):""),a)}var b=this,c=this.state;Ub>c&&d(!0),d(),c>=Ub&&d(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):(this.state=Xb,void 0)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(Xb|Rb)))return!1;a++}return!0},recognize:function(a){var b=n({},a);return r(this.options.enable,[this,b])?(this.state&(Vb|Wb|Xb)&&(this.state=Rb),this.state=this.process(b),this.state&(Sb|Tb|Ub|Wb)&&this.tryEmit(b),void 0):(this.reset(),this.state=Xb,void 0)},process:function(){},getTouchAction:function(){},reset:function(){}},p(ac,Yb,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(Sb|Tb),e=this.attrTest(a);return d&&(c&R||!e)?b|Wb:d||e?c&Q?b|Ub:b&Sb?b|Tb:Sb:Xb}}),p(bc,ac,{defaults:{event:"pan",threshold:10,pointers:1,direction:Z},getTouchAction:function(){var a=this.options.direction,b=[];return a&X&&b.push(Ob),a&Y&&b.push(Nb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&X?(e=0===f?S:0>f?T:U,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?S:0>g?V:W,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return ac.prototype.attrTest.call(this,a)&&(this.state&Sb||!(this.state&Sb)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),p(cc,ac,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&Sb)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),p(dc,Yb,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[Kb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Q|R)&&!e)this.reset();else if(a.eventType&O)this.reset(),this._timer=k(function(){this.state=Vb,this.tryEmit()},b.time,this);else if(a.eventType&Q)return Vb;return Xb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===Vb&&(a&&a.eventType&Q?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=j(),this.manager.emit(this.options.event,this._input)))}}),p(ec,ac,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&Sb)}}),p(fc,ac,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:X|Y,pointers:1},getTouchAction:function(){return bc.prototype.getTouchAction.call(this)},attrTest:function(a){var c,b=this.options.direction;return b&(X|Y)?c=a.velocity:b&X?c=a.velocityX:b&Y&&(c=a.velocityY),this._super.attrTest.call(this,a)&&b&a.direction&&a.distance>this.options.threshold&&i(c)>this.options.velocity&&a.eventType&Q},emit:function(a){var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),p(gc,Yb,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[Lb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime<b.time;if(this.reset(),a.eventType&O&&0===this.count)return this.failTimeout();if(d&&e&&c){if(a.eventType!=Q)return this.failTimeout();var f=this.pTime?a.timeStamp-this.pTime<b.interval:!0,g=!this.pCenter||kb(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,g&&f?this.count+=1:this.count=1,this._input=a;var h=this.count%b.taps;if(0===h)return this.hasRequireFailures()?(this._timer=k(function(){this.state=Vb,this.tryEmit()},b.interval,this),Sb):Vb}return Xb},failTimeout:function(){return this._timer=k(function(){this.state=Xb},this.options.interval,this),Xb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Vb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),hc.VERSION="2.0.4",hc.defaults={domEvents:!1,touchAction:Jb,enable:!0,inputTarget:null,inputClass:null,preset:[[ec,{enable:!1}],[cc,{enable:!1},["rotate"]],[fc,{direction:X}],[bc,{direction:X},["swipe"]],[gc],[gc,{event:"doubletap",taps:2},["tap"]],[dc]],cssProps:{userSelect:"default",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ic=1,jc=2;kc.prototype={set:function(a){return n(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?jc:ic},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&Vb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===jc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(Sb|Tb|Ub)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Yb)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(l(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(l(a,"remove",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(y(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return m(x(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return m(x(a),function(a){b?c[a].splice(y(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&mc(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&lc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},n(hc,{INPUT_START:O,INPUT_MOVE:P,INPUT_END:Q,INPUT_CANCEL:R,STATE_POSSIBLE:Rb,STATE_BEGAN:Sb,STATE_CHANGED:Tb,STATE_ENDED:Ub,STATE_RECOGNIZED:Vb,STATE_CANCELLED:Wb,STATE_FAILED:Xb,DIRECTION_NONE:S,DIRECTION_LEFT:T,DIRECTION_RIGHT:U,DIRECTION_UP:V,DIRECTION_DOWN:W,DIRECTION_HORIZONTAL:X,DIRECTION_VERTICAL:Y,DIRECTION_ALL:Z,Manager:kc,Input:ab,TouchAction:Pb,TouchInput:Eb,MouseInput:rb,PointerEventInput:wb,TouchMouseInput:Gb,SingleTouchInput:Ab,Recognizer:Yb,AttrRecognizer:ac,Tap:gc,Pan:bc,Swipe:fc,Pinch:cc,Rotate:ec,Press:dc,on:t,off:u,each:m,merge:o,extend:n,inherit:p,bindFn:q,prefixed:B}),typeof define==g&&define.amd?define(function(){return hc}):"undefined"!=typeof module&&module.exports?module.exports=hc:a[c]=hc}(window,document,"Hammer");
|
1
|
+
!function(a,b,c,d){"use strict";function k(a,b,c){return setTimeout(q(a,c),b)}function l(a,b,c){return Array.isArray(a)?(m(a,c[b],c),!0):!1}function m(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function n(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}function o(a,b){return n(a,b,!0)}function p(a,b,c){var e,d=b.prototype;e=a.prototype=Object.create(d),e.constructor=a,e._super=d,c&&n(e,c)}function q(a,b){return function(){return a.apply(b,arguments)}}function r(a,b){return typeof a==g?a.apply(b?b[0]||d:d,b):a}function s(a,b){return a===d?b:a}function t(a,b,c){m(x(b),function(b){a.addEventListener(b,c,!1)})}function u(a,b,c){m(x(b),function(b){a.removeEventListener(b,c,!1)})}function v(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function w(a,b){return a.indexOf(b)>-1}function x(a){return a.trim().split(/\s+/g)}function y(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function z(a){return Array.prototype.slice.call(a,0)}function A(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];y(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function B(a,b){for(var c,f,g=b[0].toUpperCase()+b.slice(1),h=0;h<e.length;){if(c=e[h],f=c?c+g:b,f in a)return f;h++}return d}function D(){return C++}function E(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function ab(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){r(a.options.enable,[a])&&c.handler(b)},this.init()}function bb(a){var b,c=a.options.inputClass;return b=c?c:H?wb:I?Eb:G?Gb:rb,new b(a,cb)}function cb(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&O&&0===d-e,g=b&(Q|R)&&0===d-e;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,db(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function db(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=gb(b)),e>1&&!c.firstMultiple?c.firstMultiple=gb(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=hb(d);b.timeStamp=j(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=lb(h,i),b.distance=kb(h,i),eb(c,b),b.offsetDirection=jb(b.deltaX,b.deltaY),b.scale=g?nb(g.pointers,d):1,b.rotation=g?mb(g.pointers,d):0,fb(c,b);var k=a.element;v(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function eb(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===O||f.eventType===Q)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function fb(a,b){var f,g,h,j,c=a.lastInterval||b,e=b.timeStamp-c.timeStamp;if(b.eventType!=R&&(e>N||c.velocity===d)){var k=c.deltaX-b.deltaX,l=c.deltaY-b.deltaY,m=ib(e,k,l);g=m.x,h=m.y,f=i(m.x)>i(m.y)?m.x:m.y,j=jb(k,l),a.lastInterval=b}else f=c.velocity,g=c.velocityX,h=c.velocityY,j=c.direction;b.velocity=f,b.velocityX=g,b.velocityY=h,b.direction=j}function gb(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:h(a.pointers[c].clientX),clientY:h(a.pointers[c].clientY)},c++;return{timeStamp:j(),pointers:b,center:hb(b),deltaX:a.deltaX,deltaY:a.deltaY}}function hb(a){var b=a.length;if(1===b)return{x:h(a[0].clientX),y:h(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:h(c/b),y:h(d/b)}}function ib(a,b,c){return{x:b/a||0,y:c/a||0}}function jb(a,b){return a===b?S:i(a)>=i(b)?a>0?T:U:b>0?V:W}function kb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function lb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function mb(a,b){return lb(b[1],b[0],_)-lb(a[1],a[0],_)}function nb(a,b){return kb(b[0],b[1],_)/kb(a[0],a[1],_)}function rb(){this.evEl=pb,this.evWin=qb,this.allow=!0,this.pressed=!1,ab.apply(this,arguments)}function wb(){this.evEl=ub,this.evWin=vb,ab.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Ab(){this.evTarget=yb,this.evWin=zb,this.started=!1,ab.apply(this,arguments)}function Bb(a,b){var c=z(a.touches),d=z(a.changedTouches);return b&(Q|R)&&(c=A(c.concat(d),"identifier",!0)),[c,d]}function Eb(){this.evTarget=Db,this.targetIds={},ab.apply(this,arguments)}function Fb(a,b){var c=z(a.touches),d=this.targetIds;if(b&(O|P)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=z(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return v(a.target,i)}),b===O)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Q|R)&&delete d[g[e].identifier],e++;return h.length?[A(f.concat(h),"identifier",!0),h]:void 0}function Gb(){ab.apply(this,arguments);var a=q(this.handler,this);this.touch=new Eb(this.manager,a),this.mouse=new rb(this.manager,a)}function Pb(a,b){this.manager=a,this.set(b)}function Qb(a){if(w(a,Mb))return Mb;var b=w(a,Nb),c=w(a,Ob);return b&&c?Nb+" "+Ob:b||c?b?Nb:Ob:w(a,Lb)?Lb:Kb}function Yb(a){this.id=D(),this.manager=null,this.options=o(a||{},this.defaults),this.options.enable=s(this.options.enable,!0),this.state=Rb,this.simultaneous={},this.requireFail=[]}function Zb(a){return a&Wb?"cancel":a&Ub?"end":a&Tb?"move":a&Sb?"start":""}function $b(a){return a==W?"down":a==V?"up":a==T?"left":a==U?"right":""}function _b(a,b){var c=b.manager;return c?c.get(a):a}function ac(){Yb.apply(this,arguments)}function bc(){ac.apply(this,arguments),this.pX=null,this.pY=null}function cc(){ac.apply(this,arguments)}function dc(){Yb.apply(this,arguments),this._timer=null,this._input=null}function ec(){ac.apply(this,arguments)}function fc(){ac.apply(this,arguments)}function gc(){Yb.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function hc(a,b){return b=b||{},b.recognizers=s(b.recognizers,hc.defaults.preset),new kc(a,b)}function kc(a,b){b=b||{},this.options=o(b,hc.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=bb(this),this.touchAction=new Pb(this,this.options.touchAction),lc(this,!0),m(b.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function lc(a,b){var c=a.element;m(a.options.cssProps,function(a,d){c.style[B(c.style,d)]=b?a:""})}function mc(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var e=["","webkit","moz","MS","ms","o"],f=b.createElement("div"),g="function",h=Math.round,i=Math.abs,j=Date.now,C=1,F=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in a,H=B(a,"PointerEvent")!==d,I=G&&F.test(navigator.userAgent),J="touch",K="pen",L="mouse",M="kinect",N=25,O=1,P=2,Q=4,R=8,S=1,T=2,U=4,V=8,W=16,X=T|U,Y=V|W,Z=X|Y,$=["x","y"],_=["clientX","clientY"];ab.prototype={handler:function(){},init:function(){this.evEl&&t(this.element,this.evEl,this.domHandler),this.evTarget&&t(this.target,this.evTarget,this.domHandler),this.evWin&&t(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&u(this.element,this.evEl,this.domHandler),this.evTarget&&u(this.target,this.evTarget,this.domHandler),this.evWin&&u(E(this.element),this.evWin,this.domHandler)}};var ob={mousedown:O,mousemove:P,mouseup:Q},pb="mousedown",qb="mousemove mouseup";p(rb,ab,{handler:function(a){var b=ob[a.type];b&O&&0===a.button&&(this.pressed=!0),b&P&&1!==a.which&&(b=Q),this.pressed&&this.allow&&(b&Q&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:L,srcEvent:a}))}});var sb={pointerdown:O,pointermove:P,pointerup:Q,pointercancel:R,pointerout:R},tb={2:J,3:K,4:L,5:M},ub="pointerdown",vb="pointermove pointerup pointercancel";a.MSPointerEvent&&(ub="MSPointerDown",vb="MSPointerMove MSPointerUp MSPointerCancel"),p(wb,ab,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=sb[d],f=tb[a.pointerType]||a.pointerType,g=f==J,h=y(b,a.pointerId,"pointerId");e&O&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Q|R)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var xb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},yb="touchstart",zb="touchstart touchmove touchend touchcancel";p(Ab,ab,{handler:function(a){var b=xb[a.type];if(b===O&&(this.started=!0),this.started){var c=Bb.call(this,a,b);b&(Q|R)&&0===c[0].length-c[1].length&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}});var Cb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},Db="touchstart touchmove touchend touchcancel";p(Eb,ab,{handler:function(a){var b=Cb[a.type],c=Fb.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}),p(Gb,ab,{handler:function(a,b,c){var d=c.pointerType==J,e=c.pointerType==L;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Q|R)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Hb=B(f.style,"touchAction"),Ib=Hb!==d,Jb="compute",Kb="auto",Lb="manipulation",Mb="none",Nb="pan-x",Ob="pan-y";Pb.prototype={set:function(a){a==Jb&&(a=this.compute()),Ib&&(this.manager.element.style[Hb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return m(this.manager.recognizers,function(b){r(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),Qb(a.join(" "))},preventDefaults:function(a){if(!Ib){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return b.preventDefault(),void 0;var d=this.actions,e=w(d,Mb),f=w(d,Ob),g=w(d,Nb);return e||f&&c&X||g&&c&Y?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var Rb=1,Sb=2,Tb=4,Ub=8,Vb=Ub,Wb=16,Xb=32;Yb.prototype={defaults:{},set:function(a){return n(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(l(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_b(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return l(a,"dropRecognizeWith",this)?this:(a=_b(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(l(a,"requireFailure",this))return this;var b=this.requireFail;return a=_b(a,this),-1===y(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(l(a,"dropRequireFailure",this))return this;a=_b(a,this);var b=y(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function d(d){b.manager.emit(b.options.event+(d?Zb(c):""),a)}var b=this,c=this.state;Ub>c&&d(!0),d(),c>=Ub&&d(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):(this.state=Xb,void 0)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(Xb|Rb)))return!1;a++}return!0},recognize:function(a){var b=n({},a);return r(this.options.enable,[this,b])?(this.state&(Vb|Wb|Xb)&&(this.state=Rb),this.state=this.process(b),this.state&(Sb|Tb|Ub|Wb)&&this.tryEmit(b),void 0):(this.reset(),this.state=Xb,void 0)},process:function(){},getTouchAction:function(){},reset:function(){}},p(ac,Yb,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(Sb|Tb),e=this.attrTest(a);return d&&(c&R||!e)?b|Wb:d||e?c&Q?b|Ub:b&Sb?b|Tb:Sb:Xb}}),p(bc,ac,{defaults:{event:"pan",threshold:10,pointers:1,direction:Z},getTouchAction:function(){var a=this.options.direction,b=[];return a&X&&b.push(Ob),a&Y&&b.push(Nb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&X?(e=0===f?S:0>f?T:U,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?S:0>g?V:W,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return ac.prototype.attrTest.call(this,a)&&(this.state&Sb||!(this.state&Sb)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),p(cc,ac,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&Sb)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),p(dc,Yb,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[Kb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Q|R)&&!e)this.reset();else if(a.eventType&O)this.reset(),this._timer=k(function(){this.state=Vb,this.tryEmit()},b.time,this);else if(a.eventType&Q)return Vb;return Xb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===Vb&&(a&&a.eventType&Q?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=j(),this.manager.emit(this.options.event,this._input)))}}),p(ec,ac,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&Sb)}}),p(fc,ac,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:X|Y,pointers:1},getTouchAction:function(){return bc.prototype.getTouchAction.call(this)},attrTest:function(a){var c,b=this.options.direction;return b&(X|Y)?c=a.velocity:b&X?c=a.velocityX:b&Y&&(c=a.velocityY),this._super.attrTest.call(this,a)&&b&a.direction&&a.distance>this.options.threshold&&i(c)>this.options.velocity&&a.eventType&Q},emit:function(a){var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),p(gc,Yb,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[Lb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime<b.time;if(this.reset(),a.eventType&O&&0===this.count)return this.failTimeout();if(d&&e&&c){if(a.eventType!=Q)return this.failTimeout();var f=this.pTime?a.timeStamp-this.pTime<b.interval:!0,g=!this.pCenter||kb(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,g&&f?this.count+=1:this.count=1,this._input=a;var h=this.count%b.taps;if(0===h)return this.hasRequireFailures()?(this._timer=k(function(){this.state=Vb,this.tryEmit()},b.interval,this),Sb):Vb}return Xb},failTimeout:function(){return this._timer=k(function(){this.state=Xb},this.options.interval,this),Xb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Vb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),hc.VERSION="2.0.4",hc.defaults={domEvents:!1,touchAction:Jb,enable:!0,inputTarget:null,inputClass:null,preset:[[ec,{enable:!1}],[cc,{enable:!1},["rotate"]],[fc,{direction:X}],[bc,{direction:X},["swipe"]],[gc],[gc,{event:"doubletap",taps:2},["tap"]],[dc]],cssProps:{userSelect:"default",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ic=1,jc=2;kc.prototype={set:function(a){return n(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?jc:ic},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&Vb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===jc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(Sb|Tb|Ub)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Yb)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(l(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(l(a,"remove",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(y(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return m(x(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return m(x(a),function(a){b?c[a].splice(y(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&mc(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&lc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},n(hc,{INPUT_START:O,INPUT_MOVE:P,INPUT_END:Q,INPUT_CANCEL:R,STATE_POSSIBLE:Rb,STATE_BEGAN:Sb,STATE_CHANGED:Tb,STATE_ENDED:Ub,STATE_RECOGNIZED:Vb,STATE_CANCELLED:Wb,STATE_FAILED:Xb,DIRECTION_NONE:S,DIRECTION_LEFT:T,DIRECTION_RIGHT:U,DIRECTION_UP:V,DIRECTION_DOWN:W,DIRECTION_HORIZONTAL:X,DIRECTION_VERTICAL:Y,DIRECTION_ALL:Z,Manager:kc,Input:ab,TouchAction:Pb,TouchInput:Eb,MouseInput:rb,PointerEventInput:wb,TouchMouseInput:Gb,SingleTouchInput:Ab,Recognizer:Yb,AttrRecognizer:ac,Tap:gc,Pan:bc,Swipe:fc,Pinch:cc,Rotate:ec,Press:dc,on:t,off:u,each:m,merge:o,extend:n,inherit:p,bindFn:q,prefixed:B}),typeof define==g&&define.amd?define(function(){return hc}):"undefined"!=typeof module&&module.exports?module.exports=hc:a[c]=hc}(window,document,"Hammer");
|
@@ -30,6 +30,9 @@
|
|
30
30
|
if ($('nav').length) {
|
31
31
|
$('.toc-wrapper').pushpin({ top: $('nav').height() });
|
32
32
|
}
|
33
|
+
else if ($('#index-banner').length) {
|
34
|
+
$('.toc-wrapper').pushpin({ top: $('#index-banner').height() });
|
35
|
+
}
|
33
36
|
else {
|
34
37
|
$('.toc-wrapper').pushpin({ top: 0 });
|
35
38
|
}
|
@@ -46,7 +49,6 @@
|
|
46
49
|
setTimeout(checkForChanges, 500);
|
47
50
|
}
|
48
51
|
else {
|
49
|
-
console.log("no ad");
|
50
52
|
var donateAd = $('<div id="carbonads"><span><a class="carbon-text" href="#" onclick="document.getElementById("paypal_donate").submit();"><img src="images/donate.png" /> Help support us by turning off adblock. If you still prefer to keep adblock on for this page but still want to support us, feel free to donate. Any little bit helps.</a></form></span></div>');
|
51
53
|
|
52
54
|
$bsa.append(donateAd);
|
@@ -70,8 +72,6 @@
|
|
70
72
|
}
|
71
73
|
$('.github-commit').find('.date').html(date);
|
72
74
|
$('.github-commit').find('.sha').html(sha).attr('href', data.html_url);
|
73
|
-
|
74
|
-
// console.log(returndata, returndata.commit.author.date, returndata.sha);
|
75
75
|
}
|
76
76
|
});
|
77
77
|
}
|
@@ -121,7 +121,7 @@
|
|
121
121
|
$('.modal-trigger').leanModal();
|
122
122
|
$('.scrollspy').scrollSpy();
|
123
123
|
$('.button-collapse').sideNav({'edge': 'left'});
|
124
|
-
$('.datepicker').pickadate();
|
124
|
+
$('.datepicker').pickadate({selectYears: 20});
|
125
125
|
$('select').not('.disabled').material_select();
|
126
126
|
|
127
127
|
|
@@ -22,10 +22,9 @@
|
|
22
22
|
$(modal).closeModal(options);
|
23
23
|
});
|
24
24
|
// Return on ESC
|
25
|
-
$(document).keyup
|
25
|
+
$(document).on('keyup.leanModal', function(e) {
|
26
26
|
if (e.keyCode === 27) { // ESC key
|
27
27
|
$(modal).closeModal(options);
|
28
|
-
$(this).off();
|
29
28
|
}
|
30
29
|
});
|
31
30
|
}
|
@@ -39,23 +38,43 @@
|
|
39
38
|
|
40
39
|
$(modal).css({
|
41
40
|
display : "block",
|
42
|
-
top: "4%",
|
43
41
|
opacity: 0
|
44
42
|
});
|
45
43
|
|
46
44
|
$("#lean-overlay").velocity({opacity: options.opacity}, {duration: options.in_duration, queue: false, ease: "easeOutCubic"});
|
47
45
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
46
|
+
|
47
|
+
// Define Bottom Sheet animation
|
48
|
+
if ($(modal).hasClass('bottom-sheet')) {
|
49
|
+
console.log("Bottom");
|
50
|
+
$(modal).velocity({bottom: "0", opacity: 1}, {
|
51
|
+
duration: options.in_duration,
|
52
|
+
queue: false,
|
53
|
+
ease: "easeOutCubic",
|
54
|
+
// Handle modal ready callback
|
55
|
+
complete: function() {
|
56
|
+
if (typeof(options.ready) === "function") {
|
57
|
+
options.ready();
|
58
|
+
}
|
56
59
|
}
|
57
|
-
}
|
58
|
-
}
|
60
|
+
});
|
61
|
+
}
|
62
|
+
else {
|
63
|
+
$(modal).css({ top: "4%" });
|
64
|
+
$(modal).velocity({top: "10%", opacity: 1}, {
|
65
|
+
duration: options.in_duration,
|
66
|
+
queue: false,
|
67
|
+
ease: "easeOutCubic",
|
68
|
+
// Handle modal ready callback
|
69
|
+
complete: function() {
|
70
|
+
if (typeof(options.ready) === "function") {
|
71
|
+
options.ready();
|
72
|
+
}
|
73
|
+
}
|
74
|
+
});
|
75
|
+
}
|
76
|
+
|
77
|
+
|
59
78
|
}
|
60
79
|
});
|
61
80
|
|
@@ -67,17 +86,43 @@
|
|
67
86
|
}
|
68
87
|
var options = $.extend(defaults, options);
|
69
88
|
|
89
|
+
$('.modal-close').off();
|
90
|
+
$(document).off('keyup.leanModal');
|
91
|
+
|
70
92
|
$("#lean-overlay").velocity( { opacity: 0}, {duration: options.out_duration, queue: false, ease: "easeOutQuart"});
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
93
|
+
|
94
|
+
|
95
|
+
// Define Bottom Sheet animation
|
96
|
+
if ($(this).hasClass('bottom-sheet')) {
|
97
|
+
$(this).velocity({bottom: "-100%", opacity: 0}, {
|
98
|
+
duration: options.out_duration,
|
99
|
+
queue: false,
|
100
|
+
ease: "easeOutCubic",
|
101
|
+
// Handle modal ready callback
|
102
|
+
complete: function() {
|
103
|
+
$("#lean-overlay").css({display:"none"});
|
104
|
+
|
105
|
+
// Call complete callback
|
106
|
+
if (typeof(options.complete) === "function") {
|
107
|
+
options.complete();
|
108
|
+
}
|
109
|
+
$('#lean-overlay').remove();
|
110
|
+
}
|
111
|
+
});
|
112
|
+
}
|
113
|
+
else {
|
114
|
+
$(this).fadeOut(options.out_duration, function() {
|
115
|
+
$(this).css({ top: 0});
|
116
|
+
$("#lean-overlay").css({display:"none"});
|
117
|
+
|
118
|
+
// Call complete callback
|
119
|
+
if (typeof(options.complete) === "function") {
|
120
|
+
options.complete();
|
121
|
+
}
|
122
|
+
$('#lean-overlay').remove();
|
123
|
+
});
|
124
|
+
}
|
125
|
+
|
81
126
|
}
|
82
127
|
})
|
83
128
|
|
@@ -18,24 +18,27 @@
|
|
18
18
|
var placeholder = $('<div></div>').addClass('material-placeholder');
|
19
19
|
var originalWidth = 0;
|
20
20
|
var originalHeight = 0;
|
21
|
-
|
22
21
|
origin.wrap(placeholder);
|
22
|
+
|
23
|
+
|
23
24
|
origin.on('click', function(){
|
24
|
-
|
25
25
|
var placeholder = origin.parent('.material-placeholder');
|
26
26
|
var windowWidth = window.innerWidth;
|
27
27
|
var windowHeight = window.innerHeight;
|
28
28
|
var originalWidth = origin.width();
|
29
29
|
var originalHeight = origin.height();
|
30
|
+
|
30
31
|
|
31
32
|
// If already modal, return to original
|
32
33
|
if (doneAnimating === false) {
|
34
|
+
returnToOriginal();
|
33
35
|
return false;
|
34
36
|
}
|
35
37
|
else if (overlayActive && doneAnimating===true) {
|
36
38
|
returnToOriginal();
|
37
39
|
return false;
|
38
40
|
}
|
41
|
+
|
39
42
|
|
40
43
|
// Set states
|
41
44
|
doneAnimating = false;
|
@@ -50,7 +53,9 @@
|
|
50
53
|
position: 'relative',
|
51
54
|
top: 0,
|
52
55
|
left: 0
|
53
|
-
})
|
56
|
+
});
|
57
|
+
|
58
|
+
|
54
59
|
|
55
60
|
// Set css on origin
|
56
61
|
origin.css({position: 'absolute', 'z-index': 1000})
|
@@ -173,12 +178,20 @@
|
|
173
178
|
var windowHeight = window.innerHeight;
|
174
179
|
var originalWidth = origin.data('width');
|
175
180
|
var originalHeight = origin.data('height');
|
181
|
+
|
182
|
+
origin.velocity("stop", true);
|
183
|
+
$('#materialbox-overlay').velocity("stop", true);
|
184
|
+
$('.materialbox-caption').velocity("stop", true);
|
176
185
|
|
177
186
|
|
178
|
-
$('#materialbox-overlay').
|
179
|
-
//
|
180
|
-
|
181
|
-
|
187
|
+
$('#materialbox-overlay').velocity({opacity: 0}, {
|
188
|
+
duration: outDuration, // Delay prevents animation overlapping
|
189
|
+
queue: false, easing: 'easeOutQuad',
|
190
|
+
complete: function(){
|
191
|
+
// Remove Overlay
|
192
|
+
overlayActive = false;
|
193
|
+
$(this).remove();
|
194
|
+
}
|
182
195
|
});
|
183
196
|
|
184
197
|
// Resize Image
|
@@ -197,7 +210,7 @@
|
|
197
210
|
|
198
211
|
// Remove Caption + reset css settings on image
|
199
212
|
$('.materialbox-caption').velocity({opacity: 0}, {
|
200
|
-
duration: outDuration
|
213
|
+
duration: outDuration, // Delay prevents animation overlapping
|
201
214
|
queue: false, easing: 'easeOutQuad',
|
202
215
|
complete: function(){
|
203
216
|
placeholder.css({
|
@@ -210,7 +223,6 @@
|
|
210
223
|
|
211
224
|
origin.css({
|
212
225
|
height: '',
|
213
|
-
position: '',
|
214
226
|
top: '',
|
215
227
|
left: '',
|
216
228
|
width: '',
|
@@ -234,4 +246,4 @@ $(document).ready(function(){
|
|
234
246
|
$('.materialboxed').materialbox();
|
235
247
|
});
|
236
248
|
|
237
|
-
}( jQuery ));
|
249
|
+
}( jQuery ));
|
@@ -7,6 +7,11 @@
|
|
7
7
|
var $this = $(this);
|
8
8
|
$this.addClass('parallax');
|
9
9
|
|
10
|
+
$this.find('img').each(function () {
|
11
|
+
$(this).css('background-image', 'url(' + $(this).attr('src') + ')' );
|
12
|
+
$(this).attr('src', 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
|
13
|
+
});
|
14
|
+
|
10
15
|
function updateParallax(initial) {
|
11
16
|
var container_height;
|
12
17
|
if (window_width < 992) {
|
@@ -32,8 +37,12 @@
|
|
32
37
|
$this.children("img").first().css('display', 'block');
|
33
38
|
}
|
34
39
|
}
|
35
|
-
|
40
|
+
|
41
|
+
// Wait for image load
|
42
|
+
$this.children("img").one("load", function() {
|
36
43
|
updateParallax(true);
|
44
|
+
}).each(function() {
|
45
|
+
if(this.complete) $(this).load();
|
37
46
|
});
|
38
47
|
|
39
48
|
$(window).scroll(function() {
|
@@ -28,7 +28,6 @@
|
|
28
28
|
var $uniqueId = guid(),
|
29
29
|
$this = $(this),
|
30
30
|
$original_offset = $(this).offset().top;
|
31
|
-
// console.log(options.top, options.bottom, $(this).offset().top);
|
32
31
|
|
33
32
|
function removePinClasses(object) {
|
34
33
|
object.removeClass('pin-top');
|
@@ -37,14 +36,12 @@
|
|
37
36
|
}
|
38
37
|
|
39
38
|
function updateElements(objects, scrolled) {
|
40
|
-
// console.log("OBJECTS", objects);
|
41
39
|
objects.each(function () {
|
42
40
|
// Add position fixed (because its between top and bottom)
|
43
41
|
if (options.top <= scrolled && options.bottom >= scrolled && !$(this).hasClass('pinned')) {
|
44
42
|
removePinClasses($(this));
|
45
43
|
$(this).css('top', options.offset);
|
46
44
|
$(this).addClass('pinned');
|
47
|
-
// console.log("Pinned!", $(this));
|
48
45
|
}
|
49
46
|
|
50
47
|
// Add pin-top (when scrolled position is above top)
|
@@ -52,7 +49,6 @@
|
|
52
49
|
removePinClasses($(this));
|
53
50
|
$(this).css('top', 0);
|
54
51
|
$(this).addClass('pin-top');
|
55
|
-
// console.log("Pin Top!", $(this));
|
56
52
|
}
|
57
53
|
|
58
54
|
// Add pin-bottom (when scrolled position is below bottom)
|
@@ -60,28 +56,20 @@
|
|
60
56
|
removePinClasses($(this));
|
61
57
|
$(this).addClass('pin-bottom');
|
62
58
|
$(this).css('top', options.bottom - $original_offset);
|
63
|
-
// console.log("Pin Bottom!", $(this));
|
64
59
|
}
|
65
60
|
});
|
66
61
|
}
|
67
62
|
|
68
|
-
|
69
|
-
|
70
63
|
updateElements($this, $(window).scrollTop());
|
71
64
|
$(window).on('scroll.' + $uniqueId, function () {
|
72
65
|
var $scrolled = $(window).scrollTop() + options.offset;
|
73
|
-
// console.log($(window).scrollTop(), $scrolled);
|
74
66
|
updateElements($this, $scrolled);
|
75
67
|
});
|
76
68
|
|
77
|
-
});
|
78
|
-
|
79
|
-
|
69
|
+
});
|
80
70
|
|
81
71
|
};
|
82
72
|
|
83
|
-
|
84
|
-
|
85
73
|
|
86
74
|
});
|
87
75
|
}( jQuery ));
|
@@ -10,15 +10,16 @@
|
|
10
10
|
var selector = value.selector,
|
11
11
|
offset = value.offset,
|
12
12
|
callback = value.callback;
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
if (
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
|
14
|
+
if ($(selector).length != 0) {
|
15
|
+
var elementOffset = $(selector).offset().top;
|
16
|
+
|
17
|
+
if (windowScroll > (elementOffset + offset)) {
|
18
|
+
if (value.done != true) {
|
19
|
+
var callbackFunc = new Function(callback);
|
20
|
+
callbackFunc();
|
21
|
+
value.done = true;
|
22
|
+
}
|
22
23
|
}
|
23
24
|
}
|
24
25
|
|
@@ -26,4 +27,4 @@
|
|
26
27
|
});
|
27
28
|
}
|
28
29
|
|
29
|
-
})(jQuery);
|
30
|
+
})(jQuery);
|
@@ -57,25 +57,29 @@
|
|
57
57
|
// Set to width
|
58
58
|
if (options.menuWidth != 240) {
|
59
59
|
menu_id.css('width', options.menuWidth);
|
60
|
-
if (!menu_id.hasClass('fixed')) {
|
61
|
-
menu_id.css('left', -1 * (options.menuWidth + 10));
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
|
-
// Add alignment
|
66
|
-
if (options.edge != 'left') {
|
67
|
-
menu_id.addClass('right-aligned');
|
68
60
|
}
|
69
61
|
|
70
62
|
// Add Touch Area
|
71
63
|
$('body').append($('<div class="drag-target"></div>'));
|
72
|
-
|
73
|
-
|
64
|
+
|
65
|
+
if (options.edge == 'left') {
|
66
|
+
menu_id.css('left', -1 * (options.menuWidth + 10));
|
67
|
+
$('.drag-target').css({'left': 0}); // Add Touch Area
|
74
68
|
}
|
75
69
|
else {
|
76
|
-
|
70
|
+
menu_id.addClass('right-aligned') // Change text-alignment to right
|
71
|
+
.css('right', -1 * (options.menuWidth + 10))
|
72
|
+
.css('left', '');
|
73
|
+
$('.drag-target').css({'right': 0}); // Add Touch Area
|
77
74
|
}
|
78
75
|
|
76
|
+
// If fixed sidenav, bring menu out
|
77
|
+
if (menu_id.hasClass('fixed')) {
|
78
|
+
menu_id.css('left', 0);
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
|
79
83
|
// Window resize to reset on large screens fixed
|
80
84
|
if (menu_id.hasClass('fixed')) {
|
81
85
|
$(window).resize( function() {
|
@@ -115,8 +119,6 @@
|
|
115
119
|
$('.drag-target').css({width: '', right: '0', left: ''});
|
116
120
|
menu_id.velocity({right: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutCubic'});
|
117
121
|
}
|
118
|
-
|
119
|
-
// enable_scroll();
|
120
122
|
}
|
121
123
|
|
122
124
|
|
@@ -129,12 +131,10 @@
|
|
129
131
|
prevent_default: false
|
130
132
|
}).bind('tap', function(e) {
|
131
133
|
// capture overlay click on drag target
|
132
|
-
// if (menuOut && !panning) {
|
133
134
|
$('#sidenav-overlay').trigger('click');
|
134
|
-
// }
|
135
135
|
}).bind('pan', function(e) {
|
136
136
|
|
137
|
-
if (e.gesture.pointerType
|
137
|
+
if (e.gesture.pointerType == "touch") {
|
138
138
|
|
139
139
|
var direction = e.gesture.direction;
|
140
140
|
var x = e.gesture.center.x;
|
@@ -152,30 +152,34 @@
|
|
152
152
|
if (x > options.menuWidth) { x = options.menuWidth; }
|
153
153
|
else if (x < 0) { x = 0; }
|
154
154
|
}
|
155
|
-
else {
|
156
|
-
if (x < $(window).width() - options.menuWidth) { x = $(window).width() - options.menuWidth; }
|
157
|
-
}
|
158
155
|
|
159
156
|
if (options.edge === 'left') {
|
160
157
|
// Left Direction
|
161
158
|
if (x < (options.menuWidth / 2)) { menuOut = false; }
|
162
159
|
// Right Direction
|
163
160
|
else if (x >= (options.menuWidth / 2)) { menuOut = true; }
|
161
|
+
|
162
|
+
menu_id.css('left', (x - options.menuWidth));
|
164
163
|
}
|
165
164
|
else {
|
166
165
|
// Left Direction
|
167
|
-
if (x < ($(window).width() - options.menuWidth / 2)) {
|
166
|
+
if (x < ($(window).width() - options.menuWidth / 2)) {
|
167
|
+
menuOut = true;
|
168
|
+
}
|
168
169
|
// Right Direction
|
169
|
-
else if (x >= ($(window).width() - options.menuWidth / 2)) {
|
170
|
+
else if (x >= ($(window).width() - options.menuWidth / 2)) {
|
171
|
+
menuOut = false;
|
172
|
+
}
|
173
|
+
var rightPos = -1 *(x - options.menuWidth / 2);
|
174
|
+
if (rightPos > 0) {
|
175
|
+
rightPos = 0;
|
176
|
+
}
|
177
|
+
|
178
|
+
menu_id.css('right', rightPos);
|
170
179
|
}
|
171
180
|
|
172
181
|
|
173
|
-
|
174
|
-
menu_id.css('left', (x - options.menuWidth));
|
175
|
-
}
|
176
|
-
else {
|
177
|
-
menu_id.css('right', -1 *(x - options.menuWidth / 2));
|
178
|
-
}
|
182
|
+
|
179
183
|
|
180
184
|
// Percentage overlay
|
181
185
|
if (options.edge === 'left') {
|
@@ -187,54 +191,53 @@
|
|
187
191
|
$('#sidenav-overlay').velocity({opacity: overlayPerc }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
188
192
|
}
|
189
193
|
}
|
194
|
+
|
190
195
|
}).bind('panend', function(e) {
|
191
|
-
if (e.gesture.pointerType
|
196
|
+
if (e.gesture.pointerType == "touch") {
|
192
197
|
var velocityX = e.gesture.velocityX;
|
193
198
|
panning = false;
|
194
|
-
|
195
199
|
if (options.edge === 'left') {
|
196
|
-
|
200
|
+
// If velocityX <= 0.3 then the user is flinging the menu closed so ignore menuOut
|
201
|
+
if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {
|
197
202
|
menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
198
203
|
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
199
204
|
$('.drag-target').css({width: '50%', right: 0, left: ''});
|
200
205
|
}
|
201
206
|
else if (!menuOut || velocityX > 0.3) {
|
202
|
-
menu_id.velocity({left: -
|
207
|
+
menu_id.velocity({left: -1 * (options.menuWidth + 10)}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
203
208
|
$('#sidenav-overlay').velocity({opacity: 0 }, {duration: 50, queue: false, easing: 'easeOutQuad',
|
204
209
|
complete: function () {
|
205
210
|
$(this).remove();
|
206
211
|
}});
|
207
|
-
$('.drag-target').css({width: '
|
212
|
+
$('.drag-target').css({width: '10px', right: '', left: 0});
|
208
213
|
}
|
209
214
|
}
|
210
215
|
else {
|
211
|
-
if (menuOut || velocityX > 0.5) {
|
216
|
+
if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {
|
212
217
|
menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
213
218
|
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
214
219
|
$('.drag-target').css({width: '50%', right: '', left: 0});
|
215
220
|
}
|
216
221
|
else if (!menuOut || velocityX < -0.3) {
|
217
|
-
menu_id.velocity({right: -
|
222
|
+
menu_id.velocity({right: -1 * (options.menuWidth + 10)}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
218
223
|
$('#sidenav-overlay').velocity({opacity: 0 }, {duration: 50, queue: false, easing: 'easeOutQuad',
|
219
224
|
complete: function () {
|
220
225
|
$(this).remove();
|
221
226
|
}});
|
222
|
-
$('.drag-target').css({width: '
|
227
|
+
$('.drag-target').css({width: '10px', right: 0, left: ''});
|
223
228
|
}
|
224
229
|
}
|
225
230
|
|
226
|
-
|
227
231
|
}
|
228
232
|
});
|
229
233
|
|
230
234
|
$this.click(function() {
|
231
|
-
if (
|
235
|
+
if (menuOut == true) {
|
232
236
|
menuOut = false;
|
233
237
|
panning = false;
|
234
238
|
removeMenu();
|
235
239
|
}
|
236
240
|
else {
|
237
|
-
// disable_scroll();
|
238
241
|
|
239
242
|
if (options.edge === 'left') {
|
240
243
|
$('.drag-target').css({width: '50%', right: 0, left: ''});
|
@@ -243,6 +246,7 @@
|
|
243
246
|
else {
|
244
247
|
$('.drag-target').css({width: '50%', right: '', left: 0});
|
245
248
|
menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
249
|
+
menu_id.css('left','');
|
246
250
|
}
|
247
251
|
|
248
252
|
var overlay = $('<div id="sidenav-overlay"></div>');
|