Remove unnecessary end() calls

This commit is contained in:
Pavel Djundik 2017-09-12 15:52:16 +03:00
parent 15b922595f
commit 712bdafd9e
4 changed files with 12 additions and 15 deletions

View File

@ -520,23 +520,25 @@ $(function() {
e.preventDefault();
var event = "auth";
var form = $(this);
form.find(".btn")
.attr("disabled", true)
.end();
form.find(".btn").attr("disabled", true);
if (form.closest(".window").attr("id") === "connect") {
event = "conn";
} else if (form.closest("div").attr("id") === "change-password") {
event = "change-password";
}
var values = {};
$.each(form.serializeArray(), function(i, obj) {
if (obj.value !== "") {
values[obj.name] = obj.value;
}
});
if (values.user) {
storage.set("user", values.user);
}
socket.emit(
event, values
);

View File

@ -34,13 +34,9 @@ socket.on("auth", function(data) {
return;
}
$("#footer").find(".sign-in")
$("#footer")
.find(".sign-in")
.trigger("click", {
pushState: false,
})
.end()
.find(".networks")
.html("")
.next()
.show();
});
});

View File

@ -14,8 +14,7 @@ socket.on("network", function(data) {
$("#connect")
.find(".btn")
.prop("disabled", false)
.end();
.prop("disabled", false);
});
socket.on("network_changed", function(data) {

View File

@ -6,12 +6,12 @@ const sidebar = $("#sidebar");
socket.on("quit", function(data) {
const id = data.network;
sidebar.find("#network-" + id)
.remove()
.end();
sidebar.find("#network-" + id).remove();
const chan = sidebar.find(".chan")
.eq(0)
.trigger("click");
if (chan.length === 0) {
sidebar.find(".empty").show();
}