Fix that FireFox < v33 is unable to find the button that got the focus

This commit is contained in:
Johannes Meyer 2014-11-07 14:22:03 +01:00
parent 7569c55796
commit f7d168c80f
1 changed files with 8 additions and 4 deletions

View File

@ -197,6 +197,13 @@
var $target; var $target;
var data; var data;
if ($button.length === 0) {
var $el = $(event.currentTarget);
if ($el.is('input[type=submit]') || $el.is('button[type=submit]')) {
$button = $el;
}
}
if (typeof method === 'undefined') { if (typeof method === 'undefined') {
method = 'POST'; method = 'POST';
} else { } else {
@ -204,10 +211,7 @@
} }
if ($button.length === 0) { if ($button.length === 0) {
$button = $('input[type=submit]', $form).first(); $button = $('input[type=submit]', $form).add('button[type=submit]', $form).first();
if ($button.length === 0) {
$button = $('button[type=submit]', $form).first();
}
} }
event.stopPropagation(); event.stopPropagation();