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

Add support for custom user sequences #22

Merged
merged 1 commit into from
May 1, 2014
Merged
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
5 changes: 5 additions & 0 deletions jquery.velocity.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ The biggest cause of both codebase bloat and codepath obfuscation in Velocity is
},
/* Velocity's full re-implementation of jQuery's CSS stack. Made global for unit testing. */
CSS: { /* Defined below. */ },
/* An enumeration of custom animation sequences that users can add to velocity */
Sequence: {},
/* Utility function's alias of $.fn.velocity(). Used for raw DOM element animation. */
animate: function () { /* Defined below. */ },
/* Set to 1 or 2 (most verbose) to log debug info to console. */
Expand Down Expand Up @@ -1109,6 +1111,9 @@ The biggest cause of both codebase bloat and codepath obfuscation in Velocity is
/* Treat a plain, non-empty object as a literal properties map. */
if ($.isPlainObject(propertiesMap) && !$.isEmptyObject(propertiesMap)) {
action = "start";
/* Check if the specified action maps to a user-defined sequence */
} else if (typeof propertiesMap === "string" && $.velocity.Sequence[propertiesMap]) {
return $.velocity.Sequence[propertiesMap].call(elements, options);
/* Treat a string as a CSS class reference. (See CSS Class Extraction above.) */
} else if (typeof propertiesMap === "string" && $.velocity.Classes.extracted[propertiesMap]) {
/* Assign the map to that of the extracted CSS class being referenced. */
Expand Down