aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-04-02 01:03:34 +0200
committerjaubourg <j@ubourg.net>2012-04-02 01:03:34 +0200
commit7fa0da08b88534e486ddb7eb3752ef76467fb7dd (patch)
tree05d6ae32406fc0db1b8c0bc47f306739f9dcb21b /src
parenta29d482894a844724f4386f2fed0edf9cf70c069 (diff)
downloadjquery-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.js4
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 = [],