Skip to content

Commit

Permalink
add checking position style
Browse files Browse the repository at this point in the history
- when useTransition:false, useTransform:false
  • Loading branch information
sculove committed Apr 20, 2016
1 parent 2c95176 commit f59f5ca
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
6 changes: 4 additions & 2 deletions build/iscroll-infinite.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ var utils = (function () {
// initMouseEvent is deprecated.
ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
ev.initEvent('click', true, true);
ev.view = e.view;
ev.view = e.view || window;
ev.detail = 1;
ev.screenX = target.screenX || 0;
ev.screenY = target.screenY || 0;
Expand Down Expand Up @@ -348,7 +348,9 @@ function IScroll (el, options) {

// https://github.com/cubiq/iscroll/issues/1029
if (!this.options.useTransition && !this.options.useTransform) {
this.scrollerStyle.position = "relative";
if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {
this.scrollerStyle.position = "relative";
}
}

this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;
Expand Down
6 changes: 4 additions & 2 deletions build/iscroll-lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ var utils = (function () {
// initMouseEvent is deprecated.
ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
ev.initEvent('click', true, true);
ev.view = e.view;
ev.view = e.view || window;
ev.detail = 1;
ev.screenX = target.screenX || 0;
ev.screenY = target.screenY || 0;
Expand Down Expand Up @@ -341,7 +341,9 @@ function IScroll (el, options) {

// https://github.com/cubiq/iscroll/issues/1029
if (!this.options.useTransition && !this.options.useTransform) {
this.scrollerStyle.position = "relative";
if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {
this.scrollerStyle.position = "relative";
}
}

// INSERT POINT: NORMALIZATION
Expand Down
9 changes: 4 additions & 5 deletions build/iscroll-probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ var utils = (function () {
// initMouseEvent is deprecated.
ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
ev.initEvent('click', true, true);
ev.view = e.view;
ev.view = e.view || window;
ev.detail = 1;
ev.screenX = target.screenX || 0;
ev.screenY = target.screenY || 0;
Expand Down Expand Up @@ -347,7 +347,9 @@ function IScroll (el, options) {

// https://github.com/cubiq/iscroll/issues/1029
if (!this.options.useTransition && !this.options.useTransform) {
this.scrollerStyle.position = "relative";
if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {
this.scrollerStyle.position = "relative";
}
}

if ( this.options.shrinkScrollbars == 'scale' ) {
Expand Down Expand Up @@ -1928,9 +1930,6 @@ Indicator.prototype = {
},

transitionTime: function (time) {
if (!this.options.useTransition) {
return;
}
time = time || 0;
var durationProp = utils.style.transitionDuration;
if(!durationProp) {
Expand Down
9 changes: 4 additions & 5 deletions build/iscroll-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ var utils = (function () {
// initMouseEvent is deprecated.
ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
ev.initEvent('click', true, true);
ev.view = e.view;
ev.view = e.view || window;
ev.detail = 1;
ev.screenX = target.screenX || 0;
ev.screenY = target.screenY || 0;
Expand Down Expand Up @@ -350,7 +350,9 @@ function IScroll (el, options) {

// https://github.com/cubiq/iscroll/issues/1029
if (!this.options.useTransition && !this.options.useTransform) {
this.scrollerStyle.position = "relative";
if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {
this.scrollerStyle.position = "relative";
}
}

if ( this.options.shrinkScrollbars == 'scale' ) {
Expand Down Expand Up @@ -2085,9 +2087,6 @@ Indicator.prototype = {
},

transitionTime: function (time) {
if (!this.options.useTransition) {
return;
}
time = time || 0;
var durationProp = utils.style.transitionDuration;
if(!durationProp) {
Expand Down
9 changes: 4 additions & 5 deletions build/iscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ var utils = (function () {
// initMouseEvent is deprecated.
ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
ev.initEvent('click', true, true);
ev.view = e.view;
ev.view = e.view || window;
ev.detail = 1;
ev.screenX = target.screenX || 0;
ev.screenY = target.screenY || 0;
Expand Down Expand Up @@ -347,7 +347,9 @@ function IScroll (el, options) {

// https://github.com/cubiq/iscroll/issues/1029
if (!this.options.useTransition && !this.options.useTransform) {
this.scrollerStyle.position = "relative";
if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {
this.scrollerStyle.position = "relative";
}
}

if ( this.options.shrinkScrollbars == 'scale' ) {
Expand Down Expand Up @@ -1901,9 +1903,6 @@ Indicator.prototype = {
},

transitionTime: function (time) {
if (!this.options.useTransition) {
return;
}
time = time || 0;
var durationProp = utils.style.transitionDuration;
if(!durationProp) {
Expand Down
4 changes: 3 additions & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ function IScroll (el, options) {

// https://github.com/cubiq/iscroll/issues/1029
if (!this.options.useTransition && !this.options.useTransform) {
this.scrollerStyle.position = "relative";
if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {
this.scrollerStyle.position = "relative";
}
}

// INSERT POINT: NORMALIZATION
Expand Down
3 changes: 0 additions & 3 deletions src/indicator/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@ Indicator.prototype = {
},

transitionTime: function (time) {
if (!this.options.useTransition) {
return;
}
time = time || 0;
var durationProp = utils.style.transitionDuration;
if(!durationProp) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ var utils = (function () {
// initMouseEvent is deprecated.
ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
ev.initEvent('click', true, true);
ev.view = e.view;
ev.view = e.view || window;
ev.detail = 1;
ev.screenX = target.screenX || 0;
ev.screenY = target.screenY || 0;
Expand Down

0 comments on commit f59f5ca

Please sign in to comment.