mirror of https://github.com/zulip/zulip.git
Only register the callback for creating a new class once.
Previously, when trying to send a zephyr to a new class, you would actually send N zephyrs, where N is the number of times you'd created a new class. (imported from commit 2c36b0282c8c2291e05b5ad952f5b25e3f43d406)
This commit is contained in:
parent
a12f582d92
commit
d7f453dfb3
|
@ -11,6 +11,14 @@ $(function () {
|
|||
$('#zephyr-type-tabs a[href="#personal-message"]').on('shown', function (e) {
|
||||
$('#personal-message input:not(:hidden):first').focus().select();
|
||||
});
|
||||
|
||||
// Prepare the click handler for subbing to a new class to which
|
||||
// you have composed a zephyr.
|
||||
$('#create-it').click(function () {
|
||||
sub(compose_class_name());
|
||||
$("#class-message form").ajaxSubmit();
|
||||
$('#class-dne').stop(true).fadeOut(500);
|
||||
});
|
||||
});
|
||||
|
||||
$.ajaxSetup({
|
||||
|
@ -102,11 +110,7 @@ $(function () {
|
|||
send_status.toggle();
|
||||
$('#class-dne-name').text(zephyr_class);
|
||||
$('#class-dne').show();
|
||||
$('#create-it').focus().click(function () {
|
||||
sub(compose_class_name());
|
||||
$("#class-message form").ajaxSubmit();
|
||||
$('#class-dne').stop(true).fadeOut(500);
|
||||
});
|
||||
$('#create-it').focus();
|
||||
buttons.removeAttr('disabled');
|
||||
hide_compose();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue