@@ -114,37 +114,40 @@ objects and accept the same options:
114
114
115
115
Example:
116
116
117
- var clickago = new Clickago()
118
-
119
- clickago.register({
120
- method: addUser,
121
- thisArg: window,
122
- arguments: ["Mike", "[email protected] "]
123
- }, {
124
- method: removeUser,
125
- thisArg: window,
126
-
127
- });
117
+ ``` javascript
118
+ var clickago = new Clickago ()
128
119
120
+ clickago .register ({
121
+ method: addUser,
122
+ thisArg: window ,
123
+ arguments
: [
" Mike" ,
" [email protected] " ]
124
+ }, {
125
+ method: removeUser,
126
+ thisArg: window ,
127
+
128
+ });
129
+ ```
129
130
** .undo()**
130
131
131
132
Use ` .undo() ` to call the latest registered rollback.
132
133
133
- Example
134
+ Example:
134
135
135
- var clickago = new Clickago()
136
-
137
- clickago.register({
138
- method: addUser,
139
- thisArg: window,
140
- arguments: ["Mike", "[email protected] "]
141
- }, {
142
- method: removeUser,
143
- thisArg: window,
144
-
145
- });
136
+ ``` javascript
137
+ var clickago = new Clickago ()
146
138
147
- clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected] "]);
139
+ clickago .register ({
140
+ method: addUser,
141
+ thisArg: window ,
142
+ arguments
: [
" Mike" ,
" [email protected] " ]
143
+ }, {
144
+ method: removeUser,
145
+ thisArg: window ,
146
+
147
+ });
148
+
149
+ clickago .
undo ();
// Same as calling removeUser.apply(window, ["[email protected] "]);
150
+ ```
148
151
149
152
150
153
** .redo()**
@@ -153,21 +156,23 @@ Use redo to call the latest registered action (works only after calling the `.un
153
156
154
157
Example:
155
158
156
- var clickago = new Clickago()
157
-
158
- clickago.register({
159
- method: addUser,
160
- thisArg: window,
161
- arguments: ["Mike", "[email protected] "]
162
- }, {
163
- method: removeUser,
164
- thisArg: window,
165
-
166
- });
167
-
168
- clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected] "]);
159
+ ``` javascript
160
+ var clickago = new Clickago ()
169
161
170
- clickago.redo(); // Same as calling addUser.apply(window, ["Mike", "[email protected] "]);
162
+ clickago .register ({
163
+ method: addUser,
164
+ thisArg: window ,
165
+ arguments
: [
" Mike" ,
" [email protected] " ]
166
+ }, {
167
+ method: removeUser,
168
+ thisArg: window ,
169
+
170
+ });
171
+
172
+ clickago .
undo ();
// Same as calling removeUser.apply(window, ["[email protected] "]);
173
+
174
+ clickago .
redo ();
// Same as calling addUser.apply(window, ["Mike", "[email protected] "]);
175
+ ```
171
176
172
177
** .disable()**
173
178
@@ -176,47 +181,51 @@ method.
176
181
177
182
Example:
178
183
179
- var clickago = new Clickago()
180
-
181
- clickago.register({
182
- method: addUser,
183
- thisArg: window,
184
- arguments: ["Mike", "[email protected] "]
185
- }, {
186
- method: removeUser,
187
- thisArg: window,
188
-
189
- });
190
-
191
- clickago.disable();
184
+ ``` javascript
185
+ var clickago = new Clickago ()
192
186
193
- clickago.undo(); // Returns 'undefined' and no actions get called.
187
+ clickago .register ({
188
+ method: addUser,
189
+ thisArg: window ,
190
+ arguments
: [
" Mike" ,
" [email protected] " ]
191
+ }, {
192
+ method: removeUser,
193
+ thisArg: window ,
194
+
195
+ });
196
+
197
+ clickago .disable ();
198
+
199
+ clickago .undo (); // Returns 'undefined' and no actions get called.
200
+ ```
194
201
195
202
** .enable()**
196
203
197
204
Use this method to enable Clickago.
198
205
199
206
Example:
200
207
201
- var clickago = new Clickago()
202
-
203
- clickago.register({
204
- method: addUser,
205
- thisArg: window,
206
- arguments: ["Mike", "[email protected] "]
207
- }, {
208
- method: removeUser,
209
- thisArg: window,
210
-
211
- });
212
-
213
- clickago.disable();
214
-
215
- clickago.undo(); // Returns 'undefined' and no actions get called.
216
-
217
- clickago.enable();
208
+ ``` javascript
209
+ var clickago = new Clickago ()
218
210
219
- clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected] "]);
211
+ clickago .register ({
212
+ method: addUser,
213
+ thisArg: window ,
214
+ arguments
: [
" Mike" ,
" [email protected] " ]
215
+ }, {
216
+ method: removeUser,
217
+ thisArg: window ,
218
+
219
+ });
220
+
221
+ clickago .disable ();
222
+
223
+ clickago .undo (); // Returns 'undefined' and no actions get called.
224
+
225
+ clickago .enable ();
226
+
227
+ clickago .
undo ();
// Same as calling removeUser.apply(window, ["[email protected] "]);
228
+ ```
220
229
221
230
** .canUndo and .canRedo**
222
231
0 commit comments