mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 14:44:13 +00:00
Improved close buttons
This commit is contained in:
parent
08a78d2879
commit
3eb3ef081f
2 changed files with 12 additions and 5 deletions
|
@ -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}}
|
||||
|
|
|
@ -121,18 +121,25 @@ $(function() {
|
|||
.removeClass("highlight")
|
||||
.empty();
|
||||
var window = $(target)
|
||||
.css("z-index", z++)
|
||||
.css("z-index", z++)
|
||||
.find("input")
|
||||
.focus();
|
||||
});
|
||||
|
||||
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 a new issue