Remove unnecessary end() calls
This commit is contained in:
parent
15b922595f
commit
712bdafd9e
@ -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
|
||||
);
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user