@@ -40,7 +40,7 @@ module('data-disable-with', {
4040 } ) ) ;
4141 } ,
4242 teardown : function ( ) {
43- $ ( document ) . unbind ( 'iframe:loaded' ) ;
43+ $ ( document ) . off ( 'iframe:loaded' ) ;
4444 }
4545} ) ;
4646
@@ -49,7 +49,7 @@ asyncTest('form input field with "data-disable-with" attribute', 7, function() {
4949
5050 App . checkEnabledState ( input , 'john' ) ;
5151
52- form . bind ( 'ajax:success' , function ( e , data ) {
52+ form . on ( 'ajax:success' , function ( e , data ) {
5353 setTimeout ( function ( ) {
5454 App . checkEnabledState ( input , 'john' ) ;
5555 equal ( data . params . user_name , 'john' ) ;
@@ -67,7 +67,7 @@ asyncTest('blank form input field with "data-disable-with" attribute', 7, functi
6767 input . val ( '' ) ;
6868 App . checkEnabledState ( input , '' ) ;
6969
70- form . bind ( 'ajax:success' , function ( e , data ) {
70+ form . on ( 'ajax:success' , function ( e , data ) {
7171 setTimeout ( function ( ) {
7272 App . checkEnabledState ( input , '' ) ;
7373 equal ( data . params . user_name , '' ) ;
@@ -85,7 +85,7 @@ asyncTest('form button with "data-disable-with" attribute', 6, function() {
8585
8686 App . checkEnabledState ( button , 'Submit' ) ;
8787
88- form . bind ( 'ajax:success' , function ( e , data ) {
88+ form . on ( 'ajax:success' , function ( e , data ) {
8989 setTimeout ( function ( ) {
9090 App . checkEnabledState ( button , 'Submit' ) ;
9191 start ( ) ;
@@ -102,9 +102,9 @@ asyncTest('form input[type=submit][data-disable-with] disables', 6, function(){
102102 App . checkEnabledState ( input , 'Submit' ) ;
103103
104104 // 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 ) { } ) ;
106106
107- $ ( document ) . bind ( 'iframe:loaded' , function ( e , data ) {
107+ $ ( document ) . on ( 'iframe:loaded' , function ( e , data ) {
108108 setTimeout ( function ( ) {
109109 App . checkDisabledState ( input , 'submitting ...' ) ;
110110 start ( ) ;
@@ -138,7 +138,7 @@ test('form input[type=submit][data-disable-with] re-enables when `pageshow` even
138138asyncTest ( 'form[data-remote] input[type=submit][data-disable-with] is replaced in ajax callback' , 2 , function ( ) {
139139 var form = $ ( 'form:not([data-remote])' ) . attr ( 'data-remote' , 'true' ) , origFormContents = form . html ( ) ;
140140
141- form . bind ( 'ajax:success' , function ( ) {
141+ form . on ( 'ajax:success' , function ( ) {
142142 form . html ( origFormContents ) ;
143143
144144 setTimeout ( function ( ) {
@@ -153,7 +153,7 @@ asyncTest('form[data-remote] input[data-disable-with] is replaced with disabled
153153 var form = $ ( 'form:not([data-remote])' ) . attr ( 'data-remote' , 'true' ) , input = form . find ( 'input[type=submit]' ) ,
154154 newDisabledInput = input . clone ( ) . attr ( 'disabled' , 'disabled' ) ;
155155
156- form . bind ( 'ajax:success' , function ( ) {
156+ form . on ( 'ajax:success' , function ( ) {
157157 input . replaceWith ( newDisabledInput ) ;
158158
159159 setTimeout ( function ( ) {
@@ -168,9 +168,9 @@ asyncTest('form input[type=submit][data-disable-with] using "form" attribute dis
168168 App . checkEnabledState ( input , 'Form Attr Submit' ) ;
169169
170170 // 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 ) { } ) ;
172172
173- $ ( document ) . bind ( 'iframe:loaded' , function ( e , data ) {
173+ $ ( document ) . on ( 'iframe:loaded' , function ( e , data ) {
174174 setTimeout ( function ( ) {
175175 App . checkDisabledState ( input , 'form attr submitting' ) ;
176176 start ( ) ;
@@ -188,7 +188,7 @@ asyncTest('form[data-remote] textarea[data-disable-with] attribute', 3, function
188188 var form = $ ( 'form[data-remote]' ) ,
189189 textarea = $ ( '<textarea data-disable-with="processing ..." name="user_bio">born, lived, died.</textarea>' ) . appendTo ( form ) ;
190190
191- form . bind ( 'ajax:success' , function ( e , data ) {
191+ form . on ( 'ajax:success' , function ( e , data ) {
192192 setTimeout ( function ( ) {
193193 equal ( data . params . user_bio , 'born, lived, died.' ) ;
194194 start ( ) ;
@@ -227,10 +227,10 @@ asyncTest('a[data-remote][data-disable-with] disables and re-enables', 6, functi
227227 App . checkEnabledState ( link , 'Click me' ) ;
228228
229229 link
230- . bind ( 'ajax:beforeSend' , function ( ) {
230+ . on ( 'ajax:beforeSend' , function ( ) {
231231 App . checkDisabledState ( link , 'clicking...' ) ;
232232 } )
233- . bind ( 'ajax:complete' , function ( ) {
233+ . on ( 'ajax:complete' , function ( ) {
234234 setTimeout ( function ( ) {
235235 App . checkEnabledState ( link , 'Click me' ) ;
236236 start ( ) ;
@@ -245,7 +245,7 @@ asyncTest('a[data-remote][data-disable-with] re-enables when `ajax:before` event
245245 App . checkEnabledState ( link , 'Click me' ) ;
246246
247247 link
248- . bind ( 'ajax:before' , function ( ) {
248+ . on ( 'ajax:before' , function ( ) {
249249 App . checkDisabledState ( link , 'clicking...' ) ;
250250 return false ;
251251 } )
@@ -263,7 +263,7 @@ asyncTest('a[data-remote][data-disable-with] re-enables when `ajax:beforeSend` e
263263 App . checkEnabledState ( link , 'Click me' ) ;
264264
265265 link
266- . bind ( 'ajax:beforeSend' , function ( ) {
266+ . on ( 'ajax:beforeSend' , function ( ) {
267267 App . checkDisabledState ( link , 'clicking...' ) ;
268268 return false ;
269269 } )
@@ -281,7 +281,7 @@ asyncTest('a[data-remote][data-disable-with] re-enables when `ajax:error` event
281281 App . checkEnabledState ( link , 'Click me' ) ;
282282
283283 link
284- . bind ( 'ajax:beforeSend' , function ( ) {
284+ . on ( 'ajax:beforeSend' , function ( ) {
285285 App . checkDisabledState ( link , 'clicking...' ) ;
286286 } )
287287 . trigger ( 'click' ) ;
@@ -300,7 +300,7 @@ asyncTest('form[data-remote] input|button|textarea[data-disable-with] does not d
300300 submit = $ ( '<input type="submit" data-disable-with="submitting ..." name="submit2" value="Submit" />' ) . appendTo ( form ) ;
301301
302302 form
303- . bind ( 'ajax:beforeSend' , function ( ) {
303+ . on ( 'ajax:beforeSend' , function ( ) {
304304 return false ;
305305 } )
306306 . trigger ( 'submit' ) ;
@@ -337,10 +337,10 @@ asyncTest('button[data-remote][data-disable-with] disables and re-enables', 6, f
337337 App . checkEnabledState ( button , 'Click me' ) ;
338338
339339 button
340- . bind ( 'ajax:send' , function ( ) {
340+ . on ( 'ajax:send' , function ( ) {
341341 App . checkDisabledState ( button , 'clicking...' ) ;
342342 } )
343- . bind ( 'ajax:complete' , function ( ) {
343+ . on ( 'ajax:complete' , function ( ) {
344344 setTimeout ( function ( ) {
345345 App . checkEnabledState ( button , 'Click me' ) ;
346346 start ( ) ;
@@ -355,7 +355,7 @@ asyncTest('button[data-remote][data-disable-with] re-enables when `ajax:before`
355355 App . checkEnabledState ( button , 'Click me' ) ;
356356
357357 button
358- . bind ( 'ajax:before' , function ( ) {
358+ . on ( 'ajax:before' , function ( ) {
359359 App . checkDisabledState ( button , 'clicking...' ) ;
360360 return false ;
361361 } )
@@ -373,7 +373,7 @@ asyncTest('button[data-remote][data-disable-with] re-enables when `ajax:beforeSe
373373 App . checkEnabledState ( button , 'Click me' ) ;
374374
375375 button
376- . bind ( 'ajax:beforeSend' , function ( ) {
376+ . on ( 'ajax:beforeSend' , function ( ) {
377377 App . checkDisabledState ( button , 'clicking...' ) ;
378378 return false ;
379379 } )
@@ -391,7 +391,7 @@ asyncTest('button[data-remote][data-disable-with] re-enables when `ajax:error` e
391391 App . checkEnabledState ( button , 'Click me' ) ;
392392
393393 button
394- . bind ( 'ajax:send' , function ( ) {
394+ . on ( 'ajax:send' , function ( ) {
395395 App . checkDisabledState ( button , 'clicking...' ) ;
396396 } )
397397 . trigger ( 'click' ) ;
0 commit comments