From a98c77d160cac42ebf1cb38c866c3e45be31d5b9 Mon Sep 17 00:00:00 2001 From: Hyunje Alex Jun Date: Tue, 21 Oct 2014 21:30:32 +0100 Subject: [PATCH] Release 0.5.4 1. Inner scrollbar problem fix. 2. Inner scrollbar touch event problem fix. 3. Bug fixes. --- bower.json | 2 +- min/perfect-scrollbar.min.css | 4 ++-- min/perfect-scrollbar.min.js | 4 ++-- package.json | 2 +- perfect-scrollbar.jquery.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index 7fd6b2a..903f6cf 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "perfect-scrollbar", - "version": "0.5.3", + "version": "0.5.4", "homepage": "http://noraesae.github.io/perfect-scrollbar/", "authors": [ "Hyunje Alex Jun " diff --git a/min/perfect-scrollbar.min.css b/min/perfect-scrollbar.min.css index e629e7d..a5f9e92 100644 --- a/min/perfect-scrollbar.min.css +++ b/min/perfect-scrollbar.min.css @@ -1,5 +1,5 @@ -/*! perfect-scrollbar - v0.5.3 +/*! perfect-scrollbar - v0.5.4 * http://noraesae.github.com/perfect-scrollbar/ * Copyright (c) 2014 Hyunje Alex Jun; Licensed MIT */ -.ps-container .ps-scrollbar-x-rail{position:absolute;bottom:3px;height:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover .ps-scrollbar-x-rail,.ps-container.hover .ps-scrollbar-x-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-x-rail:hover,.ps-container .ps-scrollbar-x-rail.hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-x-rail.in-scrolling{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-y-rail{position:absolute;right:3px;width:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover .ps-scrollbar-y-rail,.ps-container.hover .ps-scrollbar-y-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-y-rail:hover,.ps-container .ps-scrollbar-y-rail.hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-y-rail.in-scrolling{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-x{position:absolute;bottom:0;height:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x,.ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x{background-color:#999}.ps-container .ps-scrollbar-y{position:absolute;right:0;width:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y,.ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y{background-color:#999} \ No newline at end of file +.ps-container>.ps-scrollbar-x-rail{position:absolute;bottom:3px;height:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover>.ps-scrollbar-x-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container>.ps-scrollbar-x-rail:hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-x-rail.in-scrolling{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-y-rail{position:absolute;right:3px;width:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover>.ps-scrollbar-y-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container>.ps-scrollbar-y-rail:hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-y-rail.in-scrolling{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-x-rail>.ps-scrollbar-x{position:absolute;bottom:0;height:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x{background-color:#999}.ps-container>.ps-scrollbar-y-rail>.ps-scrollbar-y{position:absolute;right:0;width:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y{background-color:#999} \ No newline at end of file diff --git a/min/perfect-scrollbar.min.js b/min/perfect-scrollbar.min.js index 098cec5..96f228b 100644 --- a/min/perfect-scrollbar.min.js +++ b/min/perfect-scrollbar.min.js @@ -1,4 +1,4 @@ -/*! perfect-scrollbar - v0.5.3 +/*! perfect-scrollbar - v0.5.4 * http://noraesae.github.com/perfect-scrollbar/ * Copyright (c) 2014 Hyunje Alex Jun; Licensed MIT */ -(function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)})(function(e){"use strict";function o(e){return"string"==typeof e?parseInt(e,10):~~e}var n={wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,includePadding:!1},t=function(){var e=0;return function(){var o=e;return e+=1,".perfect-scrollbar-"+o}}();e.fn.perfectScrollbar=function(r,l){return this.each(function(){function i(e,n){var t=e+n,r=P-k;C=0>t?0:t>r?r:t;var l=o(C*(x-P)/(P-k));y.scrollTop(l)}function a(e,n){var t=e+n,r=S-E;X=0>t?0:t>r?r:t;var l=o(X*(D-S)/(S-E));y.scrollLeft(l)}function s(e){return L.minScrollbarLength&&(e=Math.max(e,L.minScrollbarLength)),L.maxScrollbarLength&&(e=Math.min(e,L.maxScrollbarLength)),e}function c(){var e={width:S,display:M?"inherit":"none"};e.left=W?y.scrollLeft()+S-D:y.scrollLeft(),B?e.bottom=q-y.scrollTop():e.top=R+y.scrollTop(),K.css(e);var o={top:y.scrollTop(),height:P,display:Y?"inherit":"none"};z?o.right=W?D-y.scrollLeft()-Q-U.outerWidth():Q-y.scrollLeft():o.left=W?y.scrollLeft()+2*S-D-F-U.outerWidth():F+y.scrollLeft(),H.css(o),O.css({left:X,width:E-A}),U.css({top:C,height:k-G})}function d(){K.hide(),H.hide(),S=L.includePadding?y.innerWidth():y.width(),P=L.includePadding?y.innerHeight():y.height(),D=y.prop("scrollWidth"),x=y.prop("scrollHeight"),!L.suppressScrollX&&D>S+L.scrollXMarginOffset?(M=!0,E=s(o(S*S/D)),X=o(y.scrollLeft()*(S-E)/(D-S))):(M=!1,E=0,X=0,y.scrollLeft(0)),!L.suppressScrollY&&x>P+L.scrollYMarginOffset?(Y=!0,k=s(o(P*P/x)),C=o(y.scrollTop()*(P-k)/(x-P))):(Y=!1,k=0,C=0,y.scrollTop(0)),X>=S-E&&(X=S-E),C>=P-k&&(C=P-k),c(),M?y.addClass("ps-active-x"):y.removeClass("ps-active-x"),Y?y.addClass("ps-active-y"):y.removeClass("ps-active-y"),L.suppressScrollX||K.show(),L.suppressScrollY||H.show()}function u(){var o,n;O.bind("mousedown"+j,function(e){n=e.pageX,o=O.position().left,K.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(I).bind("mousemove"+j,function(e){K.hasClass("in-scrolling")&&(a(o,e.pageX-n),d(),e.stopPropagation(),e.preventDefault())}),e(I).bind("mouseup"+j,function(){K.hasClass("in-scrolling")&&K.removeClass("in-scrolling")}),o=n=null}function p(){var o,n;U.bind("mousedown"+j,function(e){n=e.pageY,o=U.position().top,H.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(I).bind("mousemove"+j,function(e){H.hasClass("in-scrolling")&&(i(o,e.pageY-n),d(),e.stopPropagation(),e.preventDefault())}),e(I).bind("mouseup"+j,function(){H.hasClass("in-scrolling")&&H.removeClass("in-scrolling")}),o=n=null}function f(e,o){var n=y.scrollTop();if(0===e){if(!Y)return!1;if(0===n&&o>0||n>=x-P&&0>o)return!L.wheelPropagation}var t=y.scrollLeft();if(0===o){if(!M)return!1;if(0===t&&0>e||t>=D-S&&e>0)return!L.wheelPropagation}return!0}function v(){function e(e){var o=e.originalEvent.deltaX,n=-1*e.originalEvent.deltaY;return(o===void 0||n===void 0)&&(o=-1*e.originalEvent.wheelDeltaX/6,n=e.originalEvent.wheelDeltaY/6),e.originalEvent.deltaMode&&1===e.originalEvent.deltaMode&&(o*=10,n*=10),o!==o&&n!==n&&(o=0,n=e.originalEvent.wheelDelta),[o,n]}function o(o){var t=e(o),r=t[0],l=t[1];n=!1,L.useBothWheelAxes?Y&&!M?(l?y.scrollTop(y.scrollTop()-l*L.wheelSpeed):y.scrollTop(y.scrollTop()+r*L.wheelSpeed),n=!0):M&&!Y&&(r?y.scrollLeft(y.scrollLeft()+r*L.wheelSpeed):y.scrollLeft(y.scrollLeft()-l*L.wheelSpeed),n=!0):(y.scrollTop(y.scrollTop()-l*L.wheelSpeed),y.scrollLeft(y.scrollLeft()+r*L.wheelSpeed)),d(),n=n||f(r,l),n&&(o.stopPropagation(),o.preventDefault())}var n=!1;window.onwheel!==void 0?y.bind("wheel"+j,o):window.onmousewheel!==void 0&&y.bind("mousewheel"+j,o)}function h(){var o=!1;y.bind("mouseenter"+j,function(){o=!0}),y.bind("mouseleave"+j,function(){o=!1});var n=!1;e(I).bind("keydown"+j,function(t){if((!t.isDefaultPrevented||!t.isDefaultPrevented())&&o){for(var r=document.activeElement?document.activeElement:I.activeElement;r.shadowRoot;)r=r.shadowRoot.activeElement;if(!e(r).is(":input,[contenteditable]")){var l=0,i=0;switch(t.which){case 37:l=-30;break;case 38:i=30;break;case 39:l=30;break;case 40:i=-30;break;case 33:i=90;break;case 32:case 34:i=-90;break;case 35:i=t.ctrlKey?-x:-P;break;case 36:i=t.ctrlKey?y.scrollTop():P;break;default:return}y.scrollTop(y.scrollTop()-i),y.scrollLeft(y.scrollLeft()+l),n=f(l,i),n&&t.preventDefault()}}})}function b(){function e(e){e.stopPropagation()}U.bind("click"+j,e),H.bind("click"+j,function(e){var n=o(k/2),t=e.pageY-H.offset().top-n,r=P-k,l=t/r;0>l?l=0:l>1&&(l=1),y.scrollTop((x-P)*l)}),O.bind("click"+j,e),K.bind("click"+j,function(e){var n=o(E/2),t=e.pageX-K.offset().left-n,r=S-E,l=t/r;0>l?l=0:l>1&&(l=1),y.scrollLeft((D-S)*l)})}function g(){function o(e,o){y.scrollTop(y.scrollTop()-o),y.scrollLeft(y.scrollLeft()-e),d()}function n(){f=!0}function t(){f=!1}function r(e){return e.originalEvent.targetTouches?e.originalEvent.targetTouches[0]:e.originalEvent}function l(e){var o=r(e);s.pageX=o.pageX,s.pageY=o.pageY,c=(new Date).getTime(),null!==p&&clearInterval(p),e.stopPropagation()}function i(e){if(!f&&1===e.originalEvent.targetTouches.length){var n=r(e),t={pageX:n.pageX,pageY:n.pageY},l=t.pageX-s.pageX,i=t.pageY-s.pageY;o(l,i),s=t;var a=(new Date).getTime(),d=a-c;d>0&&(u.x=l/d,u.y=i/d,c=a),e.preventDefault()}}function a(){clearInterval(p),p=setInterval(function(){return.01>Math.abs(u.x)&&.01>Math.abs(u.y)?(clearInterval(p),void 0):(o(30*u.x,30*u.y),u.x*=.8,u.y*=.8,void 0)},10)}var s={},c=0,u={},p=null,f=!1;e(window).bind("touchstart"+j,n),e(window).bind("touchend"+j,t),y.bind("touchstart"+j,l),y.bind("touchmove"+j,i),y.bind("touchend"+j,a),window.PointerEvent?(e(window).bind("pointerdown"+j,n),e(window).bind("pointerup"+j,t),y.bind("pointerdown"+j,l),y.bind("pointermove"+j,i),y.bind("pointerup"+j,a)):window.MSPointerEvent&&(e(window).bind("MSPointerDown"+j,n),e(window).bind("MSPointerUp"+j,t),y.bind("MSPointerDown"+j,l),y.bind("MSPointerMove"+j,i),y.bind("MSPointerUp"+j,a))}function w(){y.bind("scroll"+j,function(){d()})}function m(){y.unbind(j),e(window).unbind(j),e(I).unbind(j),y.data("perfect-scrollbar",null),y.data("perfect-scrollbar-update",null),y.data("perfect-scrollbar-destroy",null),O.remove(),U.remove(),K.remove(),H.remove(),K=H=O=U=M=Y=S=P=D=x=E=X=q=B=R=k=C=Q=z=F=W=j=null}function T(){d(),w(),u(),p(),b(),v(),(J||N)&&g(),L.useKeyboard&&h(),y.data("perfect-scrollbar",y),y.data("perfect-scrollbar-update",d),y.data("perfect-scrollbar-destroy",m)}var L=e.extend(!0,{},n),y=e(this);if("object"==typeof r?e.extend(!0,L,r):l=r,"update"===l)return y.data("perfect-scrollbar-update")&&y.data("perfect-scrollbar-update")(),y;if("destroy"===l)return y.data("perfect-scrollbar-destroy")&&y.data("perfect-scrollbar-destroy")(),y;if(y.data("perfect-scrollbar"))return y.data("perfect-scrollbar");y.addClass("ps-container");var S,P,D,x,M,E,X,Y,k,C,W="rtl"===y.css("direction"),j=t(),I=this.ownerDocument||document,K=e("
").appendTo(y),O=e("
").appendTo(K),q=o(K.css("bottom")),B=q===q,R=B?null:o(K.css("top")),A=o(K.css("borderLeftWidth"))+o(K.css("borderRightWidth")),H=e("
").appendTo(y),U=e("
").appendTo(H),Q=o(H.css("right")),z=Q===Q,F=z?null:o(H.css("left")),G=o(K.css("borderTopWidth"))+o(K.css("borderBottomWidth")),J="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,N=null!==window.navigator.msMaxTouchPoints;return T(),y})}}); \ No newline at end of file +(function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)})(function(e){"use strict";function o(e){return"string"==typeof e?parseInt(e,10):~~e}var t={wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,includePadding:!1},n=function(){var e=0;return function(){var o=e;return e+=1,".perfect-scrollbar-"+o}}();e.fn.perfectScrollbar=function(r,l){return this.each(function(){function i(e,t){var n=e+t,r=P-k;C=0>n?0:n>r?r:n;var l=o(C*(x-P)/(P-k));y.scrollTop(l)}function a(e,t){var n=e+t,r=S-E;X=0>n?0:n>r?r:n;var l=o(X*(D-S)/(S-E));y.scrollLeft(l)}function s(e){return L.minScrollbarLength&&(e=Math.max(e,L.minScrollbarLength)),L.maxScrollbarLength&&(e=Math.min(e,L.maxScrollbarLength)),e}function c(){var e={width:S,display:M?"inherit":"none"};e.left=W?y.scrollLeft()+S-D:y.scrollLeft(),B?e.bottom=q-y.scrollTop():e.top=R+y.scrollTop(),K.css(e);var o={top:y.scrollTop(),height:P,display:Y?"inherit":"none"};z?o.right=W?D-y.scrollLeft()-Q-U.outerWidth():Q-y.scrollLeft():o.left=W?y.scrollLeft()+2*S-D-F-U.outerWidth():F+y.scrollLeft(),H.css(o),O.css({left:X,width:E-A}),U.css({top:C,height:k-G})}function d(){K.hide(),H.hide(),S=L.includePadding?y.innerWidth():y.width(),P=L.includePadding?y.innerHeight():y.height(),D=y.prop("scrollWidth"),x=y.prop("scrollHeight"),!L.suppressScrollX&&D>S+L.scrollXMarginOffset?(M=!0,E=s(o(S*S/D)),X=o(y.scrollLeft()*(S-E)/(D-S))):(M=!1,E=0,X=0,y.scrollLeft(0)),!L.suppressScrollY&&x>P+L.scrollYMarginOffset?(Y=!0,k=s(o(P*P/x)),C=o(y.scrollTop()*(P-k)/(x-P))):(Y=!1,k=0,C=0,y.scrollTop(0)),X>=S-E&&(X=S-E),C>=P-k&&(C=P-k),c(),M?y.addClass("ps-active-x"):y.removeClass("ps-active-x"),Y?y.addClass("ps-active-y"):y.removeClass("ps-active-y"),L.suppressScrollX||K.show(),L.suppressScrollY||H.show()}function p(){var o,t;O.bind("mousedown"+j,function(e){t=e.pageX,o=O.position().left,K.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(I).bind("mousemove"+j,function(e){K.hasClass("in-scrolling")&&(a(o,e.pageX-t),d(),e.stopPropagation(),e.preventDefault())}),e(I).bind("mouseup"+j,function(){K.hasClass("in-scrolling")&&K.removeClass("in-scrolling")}),o=t=null}function u(){var o,t;U.bind("mousedown"+j,function(e){t=e.pageY,o=U.position().top,H.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(I).bind("mousemove"+j,function(e){H.hasClass("in-scrolling")&&(i(o,e.pageY-t),d(),e.stopPropagation(),e.preventDefault())}),e(I).bind("mouseup"+j,function(){H.hasClass("in-scrolling")&&H.removeClass("in-scrolling")}),o=t=null}function f(e,o){var t=y.scrollTop();if(0===e){if(!Y)return!1;if(0===t&&o>0||t>=x-P&&0>o)return!L.wheelPropagation}var n=y.scrollLeft();if(0===o){if(!M)return!1;if(0===n&&0>e||n>=D-S&&e>0)return!L.wheelPropagation}return!0}function v(){function e(e){var o=e.originalEvent.deltaX,t=-1*e.originalEvent.deltaY;return(o===void 0||t===void 0)&&(o=-1*e.originalEvent.wheelDeltaX/6,t=e.originalEvent.wheelDeltaY/6),e.originalEvent.deltaMode&&1===e.originalEvent.deltaMode&&(o*=10,t*=10),o!==o&&t!==t&&(o=0,t=e.originalEvent.wheelDelta),[o,t]}function o(o){var n=e(o),r=n[0],l=n[1];t=!1,L.useBothWheelAxes?Y&&!M?(l?y.scrollTop(y.scrollTop()-l*L.wheelSpeed):y.scrollTop(y.scrollTop()+r*L.wheelSpeed),t=!0):M&&!Y&&(r?y.scrollLeft(y.scrollLeft()+r*L.wheelSpeed):y.scrollLeft(y.scrollLeft()-l*L.wheelSpeed),t=!0):(y.scrollTop(y.scrollTop()-l*L.wheelSpeed),y.scrollLeft(y.scrollLeft()+r*L.wheelSpeed)),d(),t=t||f(r,l),t&&(o.stopPropagation(),o.preventDefault())}var t=!1;window.onwheel!==void 0?y.bind("wheel"+j,o):window.onmousewheel!==void 0&&y.bind("mousewheel"+j,o)}function h(){var o=!1;y.bind("mouseenter"+j,function(){o=!0}),y.bind("mouseleave"+j,function(){o=!1});var t=!1;e(I).bind("keydown"+j,function(n){if((!n.isDefaultPrevented||!n.isDefaultPrevented())&&o){for(var r=document.activeElement?document.activeElement:I.activeElement;r.shadowRoot;)r=r.shadowRoot.activeElement;if(!e(r).is(":input,[contenteditable]")){var l=0,i=0;switch(n.which){case 37:l=-30;break;case 38:i=30;break;case 39:l=30;break;case 40:i=-30;break;case 33:i=90;break;case 32:case 34:i=-90;break;case 35:i=n.ctrlKey?-x:-P;break;case 36:i=n.ctrlKey?y.scrollTop():P;break;default:return}y.scrollTop(y.scrollTop()-i),y.scrollLeft(y.scrollLeft()+l),t=f(l,i),t&&n.preventDefault()}}})}function b(){function e(e){e.stopPropagation()}U.bind("click"+j,e),H.bind("click"+j,function(e){var t=o(k/2),n=e.pageY-H.offset().top-t,r=P-k,l=n/r;0>l?l=0:l>1&&(l=1),y.scrollTop((x-P)*l)}),O.bind("click"+j,e),K.bind("click"+j,function(e){var t=o(E/2),n=e.pageX-K.offset().left-t,r=S-E,l=n/r;0>l?l=0:l>1&&(l=1),y.scrollLeft((D-S)*l)})}function g(o,t){function n(e,o){y.scrollTop(y.scrollTop()-o),y.scrollLeft(y.scrollLeft()-e),d()}function r(){h=!0}function l(){h=!1}function i(e){return e.originalEvent.targetTouches?e.originalEvent.targetTouches[0]:e.originalEvent}function a(e){var o=i(e);p.pageX=o.pageX,p.pageY=o.pageY,u=(new Date).getTime(),null!==v&&clearInterval(v),e.stopPropagation(),e.preventDefault()}function s(e){if(!h&&1===e.originalEvent.targetTouches.length){var o=i(e),t={pageX:o.pageX,pageY:o.pageY},r=t.pageX-p.pageX,l=t.pageY-p.pageY;n(r,l),p=t;var a=(new Date).getTime(),s=a-u;s>0&&(f.x=r/s,f.y=l/s,u=a),e.stopPropagation(),e.preventDefault()}}function c(){clearInterval(v),v=setInterval(function(){return.01>Math.abs(f.x)&&.01>Math.abs(f.y)?(clearInterval(v),void 0):(n(30*f.x,30*f.y),f.x*=.8,f.y*=.8,void 0)},10)}var p={},u=0,f={},v=null,h=!1;o&&(e(window).bind("touchstart"+j,r),e(window).bind("touchend"+j,l),y.bind("touchstart"+j,a),y.bind("touchmove"+j,s),y.bind("touchend"+j,c)),t&&(window.PointerEvent?(e(window).bind("pointerdown"+j,r),e(window).bind("pointerup"+j,l),y.bind("pointerdown"+j,a),y.bind("pointermove"+j,s),y.bind("pointerup"+j,c)):window.MSPointerEvent&&(e(window).bind("MSPointerDown"+j,r),e(window).bind("MSPointerUp"+j,l),y.bind("MSPointerDown"+j,a),y.bind("MSPointerMove"+j,s),y.bind("MSPointerUp"+j,c)))}function w(){y.bind("scroll"+j,function(){d()})}function m(){y.unbind(j),e(window).unbind(j),e(I).unbind(j),y.data("perfect-scrollbar",null),y.data("perfect-scrollbar-update",null),y.data("perfect-scrollbar-destroy",null),O.remove(),U.remove(),K.remove(),H.remove(),K=H=O=U=M=Y=S=P=D=x=E=X=q=B=R=k=C=Q=z=F=W=j=null}function T(){d(),w(),p(),u(),b(),v(),(J||N)&&g(J,N),L.useKeyboard&&h(),y.data("perfect-scrollbar",y),y.data("perfect-scrollbar-update",d),y.data("perfect-scrollbar-destroy",m)}var L=e.extend(!0,{},t),y=e(this);if("object"==typeof r?e.extend(!0,L,r):l=r,"update"===l)return y.data("perfect-scrollbar-update")&&y.data("perfect-scrollbar-update")(),y;if("destroy"===l)return y.data("perfect-scrollbar-destroy")&&y.data("perfect-scrollbar-destroy")(),y;if(y.data("perfect-scrollbar"))return y.data("perfect-scrollbar");y.addClass("ps-container");var S,P,D,x,M,E,X,Y,k,C,W="rtl"===y.css("direction"),j=n(),I=this.ownerDocument||document,K=e("
").appendTo(y),O=e("
").appendTo(K),q=o(K.css("bottom")),B=q===q,R=B?null:o(K.css("top")),A=o(K.css("borderLeftWidth"))+o(K.css("borderRightWidth")),H=e("
").appendTo(y),U=e("
").appendTo(H),Q=o(H.css("right")),z=Q===Q,F=z?null:o(H.css("left")),G=o(K.css("borderTopWidth"))+o(K.css("borderBottomWidth")),J="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,N=null!==window.navigator.msMaxTouchPoints;return T(),y})}}); \ No newline at end of file diff --git a/package.json b/package.json index e526192..317df16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "perfect-scrollbar", - "version": "0.5.3", + "version": "0.5.4", "description": "Tiny but perfect jquery scrollbar plugin.", "author": "Hyunje Alex Jun ", "contributors": [{ diff --git a/perfect-scrollbar.jquery.json b/perfect-scrollbar.jquery.json index 8fe596f..e38ac23 100644 --- a/perfect-scrollbar.jquery.json +++ b/perfect-scrollbar.jquery.json @@ -2,7 +2,7 @@ "name": "perfect-scrollbar", "title": "perfect-scrollbar", "description": "Tiny but perfect jquery scrollbar plugin.", - "version": "0.5.3", + "version": "0.5.4", "author": { "name": "Hyunje Alex Jun", "email": "me@noraesae.net",