diff options
author | jaubourg <j@ubourg.net> | 2012-04-02 01:03:34 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-04-02 01:03:34 +0200 |
commit | 7fa0da08b88534e486ddb7eb3752ef76467fb7dd (patch) | |
tree | 05d6ae32406fc0db1b8c0bc47f306739f9dcb21b /src | |
parent | a29d482894a844724f4386f2fed0edf9cf70c069 (diff) | |
download | jquery-7fa0da08b88534e486ddb7eb3752ef76467fb7dd.tar.gz jquery-7fa0da08b88534e486ddb7eb3752ef76467fb7dd.zip |
Allows traditional options object for $.Callbacks flags. Fixes #11011. Unit tests added.
Diffstat (limited to 'src')
-rw-r--r-- | src/callbacks.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/callbacks.js b/src/callbacks.js index 387868604..20422c35a 100644 --- a/src/callbacks.js +++ b/src/callbacks.js @@ -38,9 +38,9 @@ function createFlags( flags ) { */ jQuery.Callbacks = function( flags ) { - // Convert flags from String-formatted to Object-formatted + // Convert flags from String-formatted to Object-formatted if needed // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; + flags = typeof flags === "string" ? ( flagsCache[ flags ] || createFlags( flags ) ) : ( flags || {} ); var // Actual callback list list = [], |