mirror of https://github.com/zulip/zulip.git
Don't bracket $.get with $.ajaxSetup
Instead, use the more general $.ajax which can take these options directly. (imported from commit bb915e7d25cb6ac675d098903f7e7b57bde5006e)
This commit is contained in:
parent
9e3f588276
commit
115334c82a
|
@ -67,8 +67,10 @@ $(function () {
|
|||
return true;
|
||||
}
|
||||
var okay = true;
|
||||
$.ajaxSetup({async:false}); // so we get blocking gets
|
||||
$.get("subscriptions/exists/" + $("#class").val(), function(data) {
|
||||
$.ajax({
|
||||
url: "subscriptions/exists/" + $("#class").val(),
|
||||
async: false,
|
||||
success: function (data) {
|
||||
if (data == "False") {
|
||||
// The class doesn't exist
|
||||
okay = false;
|
||||
|
@ -76,16 +78,15 @@ $(function () {
|
|||
send_status.toggle();
|
||||
$('#class-dne-name').text($("#class").val());
|
||||
$('#class-dne').show();
|
||||
$('#create-it').focus()
|
||||
.click(function() {
|
||||
$('#create-it').focus().click(function() {
|
||||
sub($("#class").val());
|
||||
$("#class-message form").ajaxSubmit();
|
||||
$('#class-dne').stop(true).fadeOut(500);
|
||||
});
|
||||
buttons.removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
$.ajaxSetup({async:true});
|
||||
if (okay && class_list.indexOf($("#class").val()) == -1) {
|
||||
// You're not subbed to the class
|
||||
okay = false;
|
||||
|
|
Loading…
Reference in New Issue