bind, click

This commit is contained in:
James Campos 2011-09-03 16:53:27 -07:00
parent f096221f2f
commit 65af9d0625
2 changed files with 5 additions and 1 deletions

View File

@ -1331,7 +1331,8 @@
return; return;
} }
alert('Error: File too large.'); alert('Error: File too large.');
return QR.refreshFile(this); QR.refreshFile(this);
return $('[type=file]', QR.qr).click();
}, },
refreshFile: function(old) { refreshFile: function(old) {
var div, file; var div, file;
@ -1395,6 +1396,7 @@
$.bind($('.close', qr), 'click', QR.close); $.bind($('.close', qr), 'click', QR.close);
$.bind($('form', qr), 'submit', QR.submit); $.bind($('form', qr), 'submit', QR.submit);
$.bind($('#recaptcha_response_field', qr), 'keydown', QR.keydown); $.bind($('#recaptcha_response_field', qr), 'keydown', QR.keydown);
$.bind($('[type=file]', qr), 'change', QR.change);
$.bind($('#attach', qr), 'click', QR.attach); $.bind($('#attach', qr), 'click', QR.attach);
$.append(d.body, qr); $.append(d.body, qr);
ta = $('textarea', qr); ta = $('textarea', qr);

View File

@ -1040,6 +1040,7 @@ QR =
return unless @files[0].size > QR.MAX_FILE_SIZE return unless @files[0].size > QR.MAX_FILE_SIZE
alert 'Error: File too large.' alert 'Error: File too large.'
QR.refreshFile @ QR.refreshFile @
$('[type=file]', QR.qr).click()
refreshFile: (old) -> refreshFile: (old) ->
div = $.el 'div' div = $.el 'div'
innerHTML: QR.file innerHTML: QR.file
@ -1098,6 +1099,7 @@ QR =
$.bind $('.close', qr), 'click', QR.close $.bind $('.close', qr), 'click', QR.close
$.bind $('form', qr), 'submit', QR.submit $.bind $('form', qr), 'submit', QR.submit
$.bind $('#recaptcha_response_field', qr), 'keydown', QR.keydown $.bind $('#recaptcha_response_field', qr), 'keydown', QR.keydown
$.bind $('[type=file]', qr), 'change', QR.change
$.bind $('#attach', qr), 'click', QR.attach $.bind $('#attach', qr), 'click', QR.attach
$.append d.body, qr $.append d.body, qr
ta = $ 'textarea', qr ta = $ 'textarea', qr