Skip to content

Commit

Permalink
add support for custom user sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmicklos committed May 1, 2014
1 parent 2cc06e8 commit 429f1a8
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 429f1a8

Please sign in to comment.