Last active
August 29, 2015 14:01
-
-
Save pyronaur/966e9f379b7bf81257c5 to your computer and use it in GitHub Desktop.
Velocity.js CoffeeScript Love
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var argumentIndex; | |
var syntacticSugar; | |
syntacticSugar = ( arguments[0].properties !== undefined ); | |
/* Detect jQuery/Zepto elements. */ | |
if (this.jquery || (window.Zepto && window.Zepto.zepto.isZ(this))) { | |
isWrapped = true; | |
elements = this; | |
argumentIndex = 0; | |
/* Otherwise, raw elements are being animated via the utility function. */ | |
} else { | |
isWrapped = false; | |
if ( !syntacticSugar ) { | |
/* To guard from user errors, extract the raw DOM element(s) from the jQuery object if one was mistakenly passed in to the utility function. */ | |
elements = arguments[0].jquery ? [].slice.call(arguments[0]) : arguments[0]; | |
} else { | |
elements = arguments[0].elements; | |
} | |
argumentIndex = 1; | |
} | |
if( syntacticSugar ) { | |
propertiesMap = arguments[0].properties; | |
options = arguments[0].optionsl | |
} else { | |
propertiesMap = arguments[argumentIndex]; | |
options = arguments[argumentIndex + 1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment