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

Commit

Permalink
When useTransition is false _transitionTime is called
Browse files Browse the repository at this point in the history
- Although useTransition is false, wrapper element is applied as transition-timing-function and transition-duration

ref #949
  • Loading branch information
sculove committed Mar 23, 2016
1 parent 114cc30 commit 5048819
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function IScroll (el, options) {

this.options = {

// INSERT POINT: OPTIONS
// INSERT POINT: OPTIONS

startX: 0,
startY: 0,
Expand Down Expand Up @@ -57,7 +57,7 @@ function IScroll (el, options) {

// INSERT POINT: NORMALIZATION

// Some defaults
// Some defaults
this.x = 0;
this.y = 0;
this.directionX = 0;
Expand Down Expand Up @@ -128,11 +128,10 @@ IScroll.prototype = {
this.directionY = 0;
this.directionLocked = 0;

this._transitionTime();

this.startTime = utils.getTime();

if ( this.options.useTransition && this.isInTransition ) {
this._transitionTime();
this.isInTransition = false;
pos = this.getComputedPosition();
this._translate(Math.round(pos.x), Math.round(pos.y));
Expand Down Expand Up @@ -461,10 +460,12 @@ IScroll.prototype = {
easing = easing || utils.ease.circular;

this.isInTransition = this.options.useTransition && time > 0;

if ( !time || (this.options.useTransition && easing.style) ) {
this._transitionTimingFunction(easing.style);
this._transitionTime(time);
var transitionType = this.options.useTransition && easing.style;
if ( !time || transitionType ) {
if(transitionType) {
this._transitionTimingFunction(easing.style);
this._transitionTime(time);
}
this._translate(x, y);
} else {
this._animate(x, y, time, easing.fn);
Expand Down

0 comments on commit 5048819

Please sign in to comment.