Permalink
Browse files

Fixed issue with binding to 'iframe:loaded' event on form with jquery…

… 1.9
  • Loading branch information...
JangoSteve committed Jan 18, 2013
1 parent f32a303 commit 212e71ee3ae2d75b8a605565729e3fe2bb8b702c
Showing with 7 additions and 3 deletions.
  1. +7 −3 test/public/test/data-disable.js
@@ -21,6 +21,9 @@ module('data-disable', {
href: '/echo',
'data-disable-with': 'clicking...'
}));
+ },
+ teardown: function() {
+ $(document).unbind('iframe:loaded');
}
});
@@ -82,14 +85,15 @@ asyncTest('form input[type=submit][data-disable-with] disables', 6, function(){
checkEnabledState(input, 'Submit');
// WEEIRDD: attaching this handler makes the test work in IE7
- form.bind('iframe:loading', function(e, form) {});
+ $(document).bind('iframe:loading', function(e, form) {});
- form.bind('iframe:loaded', function(e, data) {
+ $(document).bind('iframe:loaded', function(e, data) {
setTimeout(function() {
checkDisabledState(input, 'submitting ...');
start();
}, 30);
- }).trigger('submit');
+ });
+ form.trigger('submit');
setTimeout(function() {
checkDisabledState(input, 'submitting ...');

0 comments on commit 212e71e

Please sign in to comment.