Only register the callback for subbing to a class once.

(imported from commit a6c41f79ea8c6e2f6a6ff5a6b41b98fd53ad4e82)
This commit is contained in:
Jessica McKellar 2012-09-14 15:25:00 -04:00
parent d7f453dfb3
commit ccfc9f5889
1 changed files with 8 additions and 5 deletions

View File

@ -19,6 +19,13 @@ $(function () {
$("#class-message form").ajaxSubmit();
$('#class-dne').stop(true).fadeOut(500);
});
// Prepare the click handler for subbing to an existing class.
$('#sub-it').click(function () {
sub(compose_class_name());
$("#class-message form").ajaxSubmit();
$('#class-nosub').stop(true).fadeOut(500);
});
});
$.ajaxSetup({
@ -123,11 +130,7 @@ $(function () {
send_status.toggle();
$('#class-nosub-name').text(zephyr_class);
$('#class-nosub').show();
$('#sub-it').focus().click(function () {
sub(compose_class_name());
$("#class-message form").ajaxSubmit();
$('#class-nosub').stop(true).fadeOut(500);
});
$('#sub-it').focus();
buttons.removeAttr('disabled');
hide_compose();
}