Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
fix interactive scrollbars
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Spinelli committed May 24, 2013
1 parent 8af643a commit fa08730
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 13 deletions.
7 changes: 5 additions & 2 deletions build/iscroll-probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,11 @@ function Indicator (scroller, options) {
this.options[i] = options[i];
}

this.sizeRatioX = 1;
this.sizeRatioY = 1;
this.maxPosX = 0;
this.maxPosY = 0;

if ( this.options.interactive ) {
utils.addEvent(this.indicator, 'touchstart', this);
utils.addEvent(this.indicator, 'MSPointerDown', this);
Expand Down Expand Up @@ -1396,8 +1401,6 @@ Indicator.prototype = {
case 'touchend':
case 'MSPointerUp':
case 'mouseup':
this._end(e);
break;
case 'touchcancel':
case 'MSPointerCancel':
case 'mousecancel':
Expand Down
7 changes: 5 additions & 2 deletions build/iscroll-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,11 @@ function Indicator (scroller, options) {
this.options[i] = options[i];
}

this.sizeRatioX = 1;
this.sizeRatioY = 1;
this.maxPosX = 0;
this.maxPosY = 0;

if ( this.options.interactive ) {
utils.addEvent(this.indicator, 'touchstart', this);
utils.addEvent(this.indicator, 'MSPointerDown', this);
Expand Down Expand Up @@ -1557,8 +1562,6 @@ Indicator.prototype = {
case 'touchend':
case 'MSPointerUp':
case 'mouseup':
this._end(e);
break;
case 'touchcancel':
case 'MSPointerCancel':
case 'mousecancel':
Expand Down
7 changes: 5 additions & 2 deletions build/iscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,11 @@ function Indicator (scroller, options) {
this.options[i] = options[i];
}

this.sizeRatioX = 1;
this.sizeRatioY = 1;
this.maxPosX = 0;
this.maxPosY = 0;

if ( this.options.interactive ) {
utils.addEvent(this.indicator, 'touchstart', this);
utils.addEvent(this.indicator, 'MSPointerDown', this);
Expand Down Expand Up @@ -1374,8 +1379,6 @@ Indicator.prototype = {
case 'touchend':
case 'MSPointerUp':
case 'mouseup':
this._end(e);
break;
case 'touchcancel':
case 'MSPointerCancel':
case 'mousecancel':
Expand Down
4 changes: 2 additions & 2 deletions demos/scrollbars/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var myScroll;

function loaded () {
myScroll = new IScroll('#wrapper', { scrollbars: true, mouseWheel: true });
myScroll = new IScroll('#wrapper', { scrollbars: true, mouseWheel: true, interactiveScrollbars: true });
}

document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
Expand Down Expand Up @@ -187,4 +187,4 @@
<div id="footer"></div>

</body>
</html>
</html>
2 changes: 1 addition & 1 deletion dist/iscroll-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/iscroll-probe-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/iscroll-zoom-min.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/indicator/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ function Indicator (scroller, options) {
this.options[i] = options[i];
}

this.sizeRatioX = 1;
this.sizeRatioY = 1;
this.maxPosX = 0;
this.maxPosY = 0;

if ( this.options.interactive ) {
utils.addEvent(this.indicator, 'touchstart', this);
utils.addEvent(this.indicator, 'MSPointerDown', this);
Expand Down Expand Up @@ -80,8 +85,6 @@ Indicator.prototype = {
case 'touchend':
case 'MSPointerUp':
case 'mouseup':
this._end(e);
break;
case 'touchcancel':
case 'MSPointerCancel':
case 'mousecancel':
Expand Down

0 comments on commit fa08730

Please sign in to comment.