@@ -40,7 +40,7 @@ module('data-disable-with', {
40
40
} ) ) ;
41
41
} ,
42
42
teardown : function ( ) {
43
- $ ( document ) . unbind ( 'iframe:loaded' ) ;
43
+ $ ( document ) . off ( 'iframe:loaded' ) ;
44
44
}
45
45
} ) ;
46
46
@@ -49,7 +49,7 @@ asyncTest('form input field with "data-disable-with" attribute', 7, function() {
49
49
50
50
App . checkEnabledState ( input , 'john' ) ;
51
51
52
- form . bind ( 'ajax:success' , function ( e , data ) {
52
+ form . on ( 'ajax:success' , function ( e , data ) {
53
53
setTimeout ( function ( ) {
54
54
App . checkEnabledState ( input , 'john' ) ;
55
55
equal ( data . params . user_name , 'john' ) ;
@@ -67,7 +67,7 @@ asyncTest('blank form input field with "data-disable-with" attribute', 7, functi
67
67
input . val ( '' ) ;
68
68
App . checkEnabledState ( input , '' ) ;
69
69
70
- form . bind ( 'ajax:success' , function ( e , data ) {
70
+ form . on ( 'ajax:success' , function ( e , data ) {
71
71
setTimeout ( function ( ) {
72
72
App . checkEnabledState ( input , '' ) ;
73
73
equal ( data . params . user_name , '' ) ;
@@ -85,7 +85,7 @@ asyncTest('form button with "data-disable-with" attribute', 6, function() {
85
85
86
86
App . checkEnabledState ( button , 'Submit' ) ;
87
87
88
- form . bind ( 'ajax:success' , function ( e , data ) {
88
+ form . on ( 'ajax:success' , function ( e , data ) {
89
89
setTimeout ( function ( ) {
90
90
App . checkEnabledState ( button , 'Submit' ) ;
91
91
start ( ) ;
@@ -102,9 +102,9 @@ asyncTest('form input[type=submit][data-disable-with] disables', 6, function(){
102
102
App . checkEnabledState ( input , 'Submit' ) ;
103
103
104
104
// WEEIRDD: attaching this handler makes the test work in IE7
105
- $ ( document ) . bind ( 'iframe:loading' , function ( e , form ) { } ) ;
105
+ $ ( document ) . on ( 'iframe:loading' , function ( e , form ) { } ) ;
106
106
107
- $ ( document ) . bind ( 'iframe:loaded' , function ( e , data ) {
107
+ $ ( document ) . on ( 'iframe:loaded' , function ( e , data ) {
108
108
setTimeout ( function ( ) {
109
109
App . checkDisabledState ( input , 'submitting ...' ) ;
110
110
start ( ) ;
@@ -138,7 +138,7 @@ test('form input[type=submit][data-disable-with] re-enables when `pageshow` even
138
138
asyncTest ( 'form[data-remote] input[type=submit][data-disable-with] is replaced in ajax callback' , 2 , function ( ) {
139
139
var form = $ ( 'form:not([data-remote])' ) . attr ( 'data-remote' , 'true' ) , origFormContents = form . html ( ) ;
140
140
141
- form . bind ( 'ajax:success' , function ( ) {
141
+ form . on ( 'ajax:success' , function ( ) {
142
142
form . html ( origFormContents ) ;
143
143
144
144
setTimeout ( function ( ) {
@@ -153,7 +153,7 @@ asyncTest('form[data-remote] input[data-disable-with] is replaced with disabled
153
153
var form = $ ( 'form:not([data-remote])' ) . attr ( 'data-remote' , 'true' ) , input = form . find ( 'input[type=submit]' ) ,
154
154
newDisabledInput = input . clone ( ) . attr ( 'disabled' , 'disabled' ) ;
155
155
156
- form . bind ( 'ajax:success' , function ( ) {
156
+ form . on ( 'ajax:success' , function ( ) {
157
157
input . replaceWith ( newDisabledInput ) ;
158
158
159
159
setTimeout ( function ( ) {
@@ -168,9 +168,9 @@ asyncTest('form input[type=submit][data-disable-with] using "form" attribute dis
168
168
App . checkEnabledState ( input , 'Form Attr Submit' ) ;
169
169
170
170
// WEEIRDD: attaching this handler makes the test work in IE7
171
- $ ( document ) . bind ( 'iframe:loading' , function ( e , form ) { } ) ;
171
+ $ ( document ) . on ( 'iframe:loading' , function ( e , form ) { } ) ;
172
172
173
- $ ( document ) . bind ( 'iframe:loaded' , function ( e , data ) {
173
+ $ ( document ) . on ( 'iframe:loaded' , function ( e , data ) {
174
174
setTimeout ( function ( ) {
175
175
App . checkDisabledState ( input , 'form attr submitting' ) ;
176
176
start ( ) ;
@@ -188,7 +188,7 @@ asyncTest('form[data-remote] textarea[data-disable-with] attribute', 3, function
188
188
var form = $ ( 'form[data-remote]' ) ,
189
189
textarea = $ ( '<textarea data-disable-with="processing ..." name="user_bio">born, lived, died.</textarea>' ) . appendTo ( form ) ;
190
190
191
- form . bind ( 'ajax:success' , function ( e , data ) {
191
+ form . on ( 'ajax:success' , function ( e , data ) {
192
192
setTimeout ( function ( ) {
193
193
equal ( data . params . user_bio , 'born, lived, died.' ) ;
194
194
start ( ) ;
@@ -227,10 +227,10 @@ asyncTest('a[data-remote][data-disable-with] disables and re-enables', 6, functi
227
227
App . checkEnabledState ( link , 'Click me' ) ;
228
228
229
229
link
230
- . bind ( 'ajax:beforeSend' , function ( ) {
230
+ . on ( 'ajax:beforeSend' , function ( ) {
231
231
App . checkDisabledState ( link , 'clicking...' ) ;
232
232
} )
233
- . bind ( 'ajax:complete' , function ( ) {
233
+ . on ( 'ajax:complete' , function ( ) {
234
234
setTimeout ( function ( ) {
235
235
App . checkEnabledState ( link , 'Click me' ) ;
236
236
start ( ) ;
@@ -245,7 +245,7 @@ asyncTest('a[data-remote][data-disable-with] re-enables when `ajax:before` event
245
245
App . checkEnabledState ( link , 'Click me' ) ;
246
246
247
247
link
248
- . bind ( 'ajax:before' , function ( ) {
248
+ . on ( 'ajax:before' , function ( ) {
249
249
App . checkDisabledState ( link , 'clicking...' ) ;
250
250
return false ;
251
251
} )
@@ -263,7 +263,7 @@ asyncTest('a[data-remote][data-disable-with] re-enables when `ajax:beforeSend` e
263
263
App . checkEnabledState ( link , 'Click me' ) ;
264
264
265
265
link
266
- . bind ( 'ajax:beforeSend' , function ( ) {
266
+ . on ( 'ajax:beforeSend' , function ( ) {
267
267
App . checkDisabledState ( link , 'clicking...' ) ;
268
268
return false ;
269
269
} )
@@ -281,7 +281,7 @@ asyncTest('a[data-remote][data-disable-with] re-enables when `ajax:error` event
281
281
App . checkEnabledState ( link , 'Click me' ) ;
282
282
283
283
link
284
- . bind ( 'ajax:beforeSend' , function ( ) {
284
+ . on ( 'ajax:beforeSend' , function ( ) {
285
285
App . checkDisabledState ( link , 'clicking...' ) ;
286
286
} )
287
287
. trigger ( 'click' ) ;
@@ -300,7 +300,7 @@ asyncTest('form[data-remote] input|button|textarea[data-disable-with] does not d
300
300
submit = $ ( '<input type="submit" data-disable-with="submitting ..." name="submit2" value="Submit" />' ) . appendTo ( form ) ;
301
301
302
302
form
303
- . bind ( 'ajax:beforeSend' , function ( ) {
303
+ . on ( 'ajax:beforeSend' , function ( ) {
304
304
return false ;
305
305
} )
306
306
. trigger ( 'submit' ) ;
@@ -337,10 +337,10 @@ asyncTest('button[data-remote][data-disable-with] disables and re-enables', 6, f
337
337
App . checkEnabledState ( button , 'Click me' ) ;
338
338
339
339
button
340
- . bind ( 'ajax:send' , function ( ) {
340
+ . on ( 'ajax:send' , function ( ) {
341
341
App . checkDisabledState ( button , 'clicking...' ) ;
342
342
} )
343
- . bind ( 'ajax:complete' , function ( ) {
343
+ . on ( 'ajax:complete' , function ( ) {
344
344
setTimeout ( function ( ) {
345
345
App . checkEnabledState ( button , 'Click me' ) ;
346
346
start ( ) ;
@@ -355,7 +355,7 @@ asyncTest('button[data-remote][data-disable-with] re-enables when `ajax:before`
355
355
App . checkEnabledState ( button , 'Click me' ) ;
356
356
357
357
button
358
- . bind ( 'ajax:before' , function ( ) {
358
+ . on ( 'ajax:before' , function ( ) {
359
359
App . checkDisabledState ( button , 'clicking...' ) ;
360
360
return false ;
361
361
} )
@@ -373,7 +373,7 @@ asyncTest('button[data-remote][data-disable-with] re-enables when `ajax:beforeSe
373
373
App . checkEnabledState ( button , 'Click me' ) ;
374
374
375
375
button
376
- . bind ( 'ajax:beforeSend' , function ( ) {
376
+ . on ( 'ajax:beforeSend' , function ( ) {
377
377
App . checkDisabledState ( button , 'clicking...' ) ;
378
378
return false ;
379
379
} )
@@ -391,7 +391,7 @@ asyncTest('button[data-remote][data-disable-with] re-enables when `ajax:error` e
391
391
App . checkEnabledState ( button , 'Click me' ) ;
392
392
393
393
button
394
- . bind ( 'ajax:send' , function ( ) {
394
+ . on ( 'ajax:send' , function ( ) {
395
395
App . checkDisabledState ( button , 'clicking...' ) ;
396
396
} )
397
397
. trigger ( 'click' ) ;
0 commit comments