Skip to content

Commit

Permalink
better support for default Android browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Spinelli committed Jun 8, 2013
1 parent 9fe8b7b commit 398b625
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 16 deletions.
1 change: 1 addition & 0 deletions .nodemonignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build/*
/dist/*
/demos/*
*.md
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ All contributions are welcome but to enforce the openess of this script I have t
If you are an individual, please sign the following form:
http://cubiq.org/iscroll/cla/individual.html

If you are a company or an entity please sing the following form:
http://cubiq.org/iscroll/cla/individual.html
If you are a company or an entity please sign the following form:
http://cubiq.org/iscroll/cla/entity.html

Thanks!
Matteo Spinelli
6 changes: 4 additions & 2 deletions build/iscroll-lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ var utils = (function () {
hasTransition: _prefixStyle('transition') in _elementStyle
});

me.isAndroidBrowser = /Android/.test(window.navigator.appVersion) && /Version\/\d/.test(window.navigator.appVersion);

me.extend(me.style = {}, {
transform: _transform,
transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
Expand Down Expand Up @@ -323,8 +325,8 @@ IScroll.prototype = {
return;
}

if ( this.options.preventDefault ) {
//e.preventDefault(); // This seems to break default Android browser
if ( this.options.preventDefault && !utils.isAndroidBrowser ) {
e.preventDefault(); // This seems to break default Android browser
}

var point = e.touches ? e.touches[0] : e,
Expand Down
6 changes: 4 additions & 2 deletions build/iscroll-probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ var utils = (function () {
hasTransition: _prefixStyle('transition') in _elementStyle
});

me.isAndroidBrowser = /Android/.test(window.navigator.appVersion) && /Version\/\d/.test(window.navigator.appVersion);

me.extend(me.style = {}, {
transform: _transform,
transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
Expand Down Expand Up @@ -348,8 +350,8 @@ IScroll.prototype = {
return;
}

if ( this.options.preventDefault ) {
//e.preventDefault(); // This seems to break default Android browser
if ( this.options.preventDefault && !utils.isAndroidBrowser ) {
e.preventDefault(); // This seems to break default Android browser
}

var point = e.touches ? e.touches[0] : e,
Expand Down
6 changes: 4 additions & 2 deletions build/iscroll-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ var utils = (function () {
hasTransition: _prefixStyle('transition') in _elementStyle
});

me.isAndroidBrowser = /Android/.test(window.navigator.appVersion) && /Version\/\d/.test(window.navigator.appVersion);

me.extend(me.style = {}, {
transform: _transform,
transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
Expand Down Expand Up @@ -354,8 +356,8 @@ IScroll.prototype = {
return;
}

if ( this.options.preventDefault ) {
//e.preventDefault(); // This seems to break default Android browser
if ( this.options.preventDefault && !utils.isAndroidBrowser ) {
e.preventDefault(); // This seems to break default Android browser
}

var point = e.touches ? e.touches[0] : e,
Expand Down
6 changes: 4 additions & 2 deletions build/iscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ var utils = (function () {
hasTransition: _prefixStyle('transition') in _elementStyle
});

me.isAndroidBrowser = /Android/.test(window.navigator.appVersion) && /Version\/\d/.test(window.navigator.appVersion);

me.extend(me.style = {}, {
transform: _transform,
transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
Expand Down Expand Up @@ -345,8 +347,8 @@ IScroll.prototype = {
return;
}

if ( this.options.preventDefault ) {
//e.preventDefault(); // This seems to break default Android browser
if ( this.options.preventDefault && !utils.isAndroidBrowser ) {
e.preventDefault(); // This seems to break default Android browser
}

var point = e.touches ? e.touches[0] : e,
Expand Down
2 changes: 1 addition & 1 deletion dist/iscroll-lite-min.js

Large diffs are not rendered by default.

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.

4 changes: 2 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ IScroll.prototype = {
return;
}

if ( this.options.preventDefault ) {
//e.preventDefault(); // This seems to break default Android browser
if ( this.options.preventDefault && !utils.isAndroidBrowser ) {
e.preventDefault(); // This seems to break default Android browser
}

var point = e.touches ? e.touches[0] : e,
Expand Down
2 changes: 2 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ var utils = (function () {
hasTransition: _prefixStyle('transition') in _elementStyle
});

me.isAndroidBrowser = /Android/.test(window.navigator.appVersion) && /Version\/\d/.test(window.navigator.appVersion);

me.extend(me.style = {}, {
transform: _transform,
transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
Expand Down

0 comments on commit 398b625

Please sign in to comment.