Skip to content

Commit

Permalink
clean up after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Spinelli committed Aug 30, 2011
1 parent 423eea6 commit ca2f3cc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
19 changes: 14 additions & 5 deletions src/iscroll-lite.js
Expand Up @@ -58,6 +58,8 @@ var m = Math,
that.options = {
hScroll: true,
vScroll: true,
x: 0,
y: 0,
bounce: true,
bounceLock: false,
momentum: true,
Expand All @@ -80,6 +82,10 @@ var m = Math,
// User defined options
for (i in options) that.options[i] = options[i];

// Set starting position
that.x = that.options.x;
that.y = that.options.y;

// Normalize options
that.options.useTransform = hasTransform ? that.options.useTransform : false;
that.options.hScrollbar = that.options.hScroll && that.options.hScrollbar;
Expand All @@ -92,9 +98,9 @@ var m = Math,
that.scroller.style[vendor + 'TransformOrigin'] = '0 0';
if (that.options.useTransition) that.scroller.style[vendor + 'TransitionTimingFunction'] = 'cubic-bezier(0.33,0.66,0.66,1)';

if (that.options.useTransform) that.scroller.style[vendor + 'Transform'] = trnOpen + '0,0' + trnClose;
else that.scroller.style.cssText += ';position:absolute;top:0;left:0';
if (that.options.useTransform) that.scroller.style[vendor + 'Transform'] = trnOpen + that.x + 'px,' + that.y + 'px' + trnClose;
else that.scroller.style.cssText += ';position:absolute;top:' + that.y + 'px;left:' + that.x + 'px';

that.refresh();

that._bind(RESIZE_EV, window);
Expand Down Expand Up @@ -375,7 +381,8 @@ iScroll.prototype = {
var that = this,
startX = that.x, startY = that.y,
startTime = Date.now(),
step, easeOut;
step, easeOut,
animate;

if (that.animating) return;

Expand All @@ -399,7 +406,8 @@ iScroll.prototype = {
else that._resetPos(0);
return;
}
var animate = function() {

animate = function () {
var now = Date.now(),
newX, newY;

Expand All @@ -418,6 +426,7 @@ iScroll.prototype = {
that._pos(newX, newY);
if (that.animating) that.aniTime = nextFrame(animate);
};

animate();
},

Expand Down
15 changes: 10 additions & 5 deletions src/iscroll.js
Expand Up @@ -107,7 +107,10 @@ var m = Math,

// User defined options
for (i in options) that.options[i] = options[i];
that.x = that.options.x; that.y = that.options.y;

// Set starting position
that.x = that.options.x;
that.y = that.options.y;

// Normalize options
that.options.useTransform = hasTransform ? that.options.useTransform : false;
Expand All @@ -122,8 +125,8 @@ var m = Math,
that.scroller.style[vendor + 'TransformOrigin'] = '0 0';
if (that.options.useTransition) that.scroller.style[vendor + 'TransitionTimingFunction'] = 'cubic-bezier(0.33,0.66,0.66,1)';

if (that.options.useTransform) that.scroller.style[vendor + 'Transform'] = trnOpen + that.x + ',' + that.y + trnClose;
else that.scroller.style.cssText += ';position:absolute;top:'+that.y+';left:'+that.x;
if (that.options.useTransform) that.scroller.style[vendor + 'Transform'] = trnOpen + that.x + 'px,' + that.y + 'px' + trnClose;
else that.scroller.style.cssText += ';position:absolute;top:' + that.y + 'px;left:' + that.x + 'px';

if (that.options.useTransition) that.options.fixedScrollbar = true;

Expand Down Expand Up @@ -682,7 +685,8 @@ iScroll.prototype = {
var that = this,
startX = that.x, startY = that.y,
startTime = Date.now(),
step, easeOut;
step, easeOut,
animate;

if (that.animating) return;

Expand All @@ -707,7 +711,7 @@ iScroll.prototype = {
return;
}

var animate = function() {
animate = function () {
var now = Date.now(),
newX, newY;

Expand All @@ -726,6 +730,7 @@ iScroll.prototype = {
that._pos(newX, newY);
if (that.animating) that.aniTime = nextFrame(animate);
};

animate();
},

Expand Down

0 comments on commit ca2f3cc

Please sign in to comment.