Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename core global to zynga so that core-js shim can be used #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
var counter = 1;

// Create namespaces
if (!global.core) {
global.core = { effect : {} };
if (!global.zynga) {
global.zynga = { effect : {} };

} else if (!core.effect) {
core.effect = {};
} else if (!zynga.effect) {
zynga.effect = {};
}

core.effect.Animate = {
zynga.effect.Animate = {

/**
* A requestAnimationFrame wrapper / polyfill.
Expand Down Expand Up @@ -221,15 +221,15 @@
completedCallback && completedCallback(desiredFrames - (dropCounter / ((now - start) / millisecondsPerSecond)), id, percent === 1 || duration == null);
} else if (render) {
lastFrame = now;
core.effect.Animate.requestAnimationFrame(step, root);
zynga.effect.Animate.requestAnimationFrame(step, root);
}
};

// Mark as running
running[id] = true;

// Init first step
core.effect.Animate.requestAnimationFrame(step, root);
zynga.effect.Animate.requestAnimationFrame(step, root);

// Return unique animation ID
return id;
Expand Down
14 changes: 7 additions & 7 deletions src/Scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ var Scroller;

// Stop deceleration
if (self.__isDecelerating) {
core.effect.Animate.stop(self.__isDecelerating);
zynga.effect.Animate.stop(self.__isDecelerating);
self.__isDecelerating = false;
}

Expand Down Expand Up @@ -532,7 +532,7 @@ var Scroller;

// Stop deceleration
if (self.__isDecelerating) {
core.effect.Animate.stop(self.__isDecelerating);
zynga.effect.Animate.stop(self.__isDecelerating);
self.__isDecelerating = false;
}

Expand Down Expand Up @@ -665,14 +665,14 @@ var Scroller;

// Stop deceleration
if (self.__isDecelerating) {
core.effect.Animate.stop(self.__isDecelerating);
zynga.effect.Animate.stop(self.__isDecelerating);
self.__isDecelerating = false;
self.__interruptedAnimation = true;
}

// Stop animation
if (self.__isAnimating) {
core.effect.Animate.stop(self.__isAnimating);
zynga.effect.Animate.stop(self.__isAnimating);
self.__isAnimating = false;
self.__interruptedAnimation = true;
}
Expand Down Expand Up @@ -1056,7 +1056,7 @@ var Scroller;
// Remember whether we had an animation, then we try to continue based on the current "drive" of the animation
var wasAnimating = self.__isAnimating;
if (wasAnimating) {
core.effect.Animate.stop(wasAnimating);
zynga.effect.Animate.stop(wasAnimating);
self.__isAnimating = false;
}

Expand Down Expand Up @@ -1113,7 +1113,7 @@ var Scroller;
};

// When continuing based on previous animation we choose an ease-out animation instead of ease-in-out
self.__isAnimating = core.effect.Animate.start(step, verify, completed, self.options.animationDuration, wasAnimating ? easeOutCubic : easeInOutCubic);
self.__isAnimating = zynga.effect.Animate.start(step, verify, completed, self.options.animationDuration, wasAnimating ? easeOutCubic : easeInOutCubic);

} else {

Expand Down Expand Up @@ -1222,7 +1222,7 @@ var Scroller;
};

// Start animation and switch on flag
self.__isDecelerating = core.effect.Animate.start(step, verify, completed);
self.__isDecelerating = zynga.effect.Animate.start(step, verify, completed);

},

Expand Down