Skip to content
This repository was archived by the owner on Jul 18, 2019. It is now read-only.

Commit caf0d44

Browse files
committed
renamed 'clear' to 'cancel' and adjusted docs
1 parent 9a5b113 commit caf0d44

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ An optional boolean, defaulting to `true`. Tells if the sequence should run as i
2525

2626

2727
## Control the sequence
28-
`.sequence()` returns a sequence controller object which is basically a `jQuery.Deferred()` loaded with some extra methods.
29-
You can run the familiar jQuery promise-like methods on the controller to determine when the sequence finishes.
28+
`.sequence()` returns a sequence controller object (called `ctrl` below).
29+
It contains a `$.Deferred()` promise as the `ctrl.promise` property, so you can run the familiar jQuery promise-like methods to determine when the sequence finishes.
3030

3131
Additionally, there are the following methods appended:
3232

33-
### `.hold()`
33+
`ctrl.hold()`
3434
Pauses the execution of the sequence instantly.
3535

36-
### `.release( [ when = "now" ] )`
36+
`ctrl.release( [ when = "now" ] )`
3737
Unpauses the execution of the sequence.
3838
The `when` parameter can either be
3939
- `"now"` to execute the next call on the sequence immediately (default)
4040
- `"delayed"` to wait a full turn and then run the callback or
4141
- `"remaining"` to resume exactly at the point where the execution was put on hold.
4242

43-
### `.runAll()`
43+
`ctrl.runAll()`
4444
Runs all remaining calls immediately.
4545
The promise will be resolved.
4646

47-
### `.clear()`
47+
`ctrl.cancel()`
4848
Puts the execution on hold and clears the sequence queue. The promise will be rejected.
4949

50-
### `.reset()`
50+
`ctrl.reset()`
5151
Resets the sequence and removes all promise handlers. Be aware that the changes made by the previous sequence calls naturally can't be reverted by this.

jquery.sequence.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ $.fn.sequence = function( callback, interval, instantly ) {
8484
};
8585

8686

87-
// stop the sequence and
88-
obj.clear = function() {
87+
// stop the sequence and clear the queue
88+
obj.cancel = function() {
8989
if ( done ) return;
9090

9191
obj.hold();

jquery.sequence.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)