File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ function createFlags( flags ) {
34
34
* after the list has been fired right away with the latest "memorized"
35
35
* values (like a Deferred)
36
36
*
37
+ * queue: only first callback in the list is called each time the list is fired
38
+ * (cannot be used in conjunction with memory)
39
+ *
37
40
* unique: will ensure a callback can only be added once (no duplicate in the list)
38
41
*
39
42
* relocate: like "unique" but will relocate the callback at the end of the list
@@ -112,6 +115,9 @@ jQuery.Callbacks = function( flags, filter ) {
112
115
if ( list [ firingIndex ] [ 1 ] . apply ( context , args ) === false && flags . stopOnFalse ) {
113
116
memory = true ; // Mark as halted
114
117
break ;
118
+ } else if ( flags . queue ) {
119
+ list . splice ( firingIndex , 1 ) ;
120
+ break ;
115
121
}
116
122
}
117
123
firing = false ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ var output,
19
19
"relocate" : "XABC X XAABC X XBB X XBA X" ,
20
20
"stopOnFalse" : "XABC X XABCABCC X XBB X XA X" ,
21
21
"addAfterFire" : "XAB X XABCAB X XBB X XABA X" ,
22
+ "queue" : "XA X XB X XB X XA X" ,
22
23
"once memory" : "XABC XABC X XA X XA XABA XC" ,
23
24
"once unique" : "XABC X X X X X XAB X" ,
24
25
"once relocate" : "XABC X X X X X XBA X" ,
You can’t perform that action at this time.
0 commit comments