check if submit is disabled

if all buttons are disabled, hitting enter in an input field won't
submit the form, but calling form.submit() will still submit
This commit is contained in:
James Campos 2011-09-05 17:21:01 -07:00
parent 967c919a98
commit 28ec967407
2 changed files with 3 additions and 2 deletions

View File

@ -1553,7 +1553,7 @@
if (input = $('#files input', qr)) {
input.setAttribute('form', 'qr_form');
}
if (!e) {
if (!(e || $('form button', qr).disabled)) {
$('#qr_form', qr).submit();
}
QR.sage = /sage/i.test($('[name=email]', qr).value);

View File

@ -1196,7 +1196,8 @@ QR =
$('#autohide', qr).checked = true if conf['Auto Hide QR']
if input = $ '#files input', qr
input.setAttribute 'form', 'qr_form'
$('#qr_form', qr).submit() if not e
if not (e or $('form button', qr).disabled)
$('#qr_form', qr).submit()
QR.sage = /sage/i.test $('[name=email]', qr).value
if conf['Thread Watcher'] and conf['Auto Watch Reply']
id = $('input[name=resto]', qr.el).value