Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Commit

Permalink
fixed probe dragging the scrollbar (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
cubiq committed Dec 7, 2013
1 parent c6a3715 commit 3a224ff
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 18 deletions.
4 changes: 2 additions & 2 deletions build/iscroll-lite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.0.7 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.0.8 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
var IScroll = (function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -308,7 +308,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.0.7',
version: '5.0.8',

_init: function () {
this._initEvents();
Expand Down
15 changes: 13 additions & 2 deletions build/iscroll-probe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.0.7 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.0.8 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
var IScroll = (function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -319,7 +319,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.0.7',
version: '5.0.8',

_init: function () {
this._initEvents();
Expand Down Expand Up @@ -1689,6 +1689,17 @@ Indicator.prototype = {

this._pos(newX, newY);


if ( this.scroller.options.probeType == 1 && timestamp - this.startTime > 300 ) {
this.startTime = timestamp;
this.scroller._execEvent('scroll');
} else if ( this.scroller.options.probeType > 1 ) {
this.scroller._execEvent('scroll');
}


// INSERT POINT: indicator._move

e.preventDefault();
e.stopPropagation();
},
Expand Down
6 changes: 4 additions & 2 deletions build/iscroll-zoom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.0.7 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.0.8 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
var IScroll = (function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -321,7 +321,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.0.7',
version: '5.0.8',

_init: function () {
this._initEvents();
Expand Down Expand Up @@ -1855,6 +1855,8 @@ Indicator.prototype = {

this._pos(newX, newY);

// INSERT POINT: indicator._move

e.preventDefault();
e.stopPropagation();
},
Expand Down
6 changes: 4 additions & 2 deletions build/iscroll.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.0.7 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.0.8 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
var IScroll = (function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -316,7 +316,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.0.7',
version: '5.0.8',

_init: function () {
this._initEvents();
Expand Down Expand Up @@ -1671,6 +1671,8 @@ Indicator.prototype = {

this._pos(newX, newY);

// INSERT POINT: indicator._move

e.preventDefault();
e.stopPropagation();
},
Expand Down
4 changes: 2 additions & 2 deletions dist/iscroll-lite-min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/iscroll-min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/iscroll-probe-min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/iscroll-zoom-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iscroll",
"description": "Smooth scrolling for the web",
"version": "5.0.7",
"version": "5.0.8",
"homepage": "http://cubiq.org/iscroll-4",
"author": "Matteo Spinelli <[email protected]> (http://cubiq.org)",
"keywords": [
Expand Down
2 changes: 2 additions & 0 deletions src/indicator/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ Indicator.prototype = {

this._pos(newX, newY);

// INSERT POINT: indicator._move

e.preventDefault();
e.stopPropagation();
},
Expand Down
3 changes: 2 additions & 1 deletion src/probe/build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"insert": {
"NORMALIZATION": "\tif ( this.options.probeType == 3 ) {\n\t\tthis.options.useTransition = false;\t}",
"_wheel": "\t\tif ( this.options.probeType > 1 ) {\n\t\t\tthis._execEvent('scroll');\n\t\t}"
"_wheel": "\t\tif ( this.options.probeType > 1 ) {\n\t\t\tthis._execEvent('scroll');\n\t\t}",
"indicator._move": "probe/indicator._move.js"
},
"replace": {
"_move": "probe/_move.js"
Expand Down
7 changes: 7 additions & 0 deletions src/probe/indicator._move.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

if ( this.scroller.options.probeType == 1 && timestamp - this.startTime > 300 ) {
this.startTime = timestamp;
this.scroller._execEvent('scroll');
} else if ( this.scroller.options.probeType > 1 ) {
this.scroller._execEvent('scroll');
}

0 comments on commit 3a224ff

Please sign in to comment.