Improved close buttons
This commit is contained in:
parent
08a78d2879
commit
3eb3ef081f
@ -38,7 +38,7 @@
|
||||
|
||||
<script type="text/html" class="channels">
|
||||
{{#each channels}}
|
||||
<button id="channel-{{id}}" class="channel" data-target="#window-{{id}}">
|
||||
<button id="channel-{{id}}" class="channel {{type}}" data-target="#window-{{id}}">
|
||||
<span class="badge"></span>
|
||||
<span class="close"></span>
|
||||
{{name}}
|
||||
|
@ -127,12 +127,19 @@ $(function() {
|
||||
});
|
||||
|
||||
sidebar.on("click", ".close", function() {
|
||||
var link = $(this);
|
||||
var channel = link.closest(".channel");
|
||||
var channel = $(this).closest(".channel");
|
||||
var id = parseInt(channel.attr("id").split("-")[1]);
|
||||
var cmd = "/close";
|
||||
if (channel.hasClass("lobby")) {
|
||||
cmd = "/quit";
|
||||
}
|
||||
socket.emit("input", {
|
||||
id: id,
|
||||
text: "/close",
|
||||
text: cmd,
|
||||
});
|
||||
channel.css({
|
||||
transition: "none",
|
||||
opacity: .4
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user