Fix window layout a bit

This commit is contained in:
Maxime Poulin 2016-07-05 19:23:46 -04:00
parent 18c615236d
commit 37b5f28919
No known key found for this signature in database
GPG Key ID: CB63C36252F40D4B
3 changed files with 48 additions and 34 deletions

View File

@ -520,12 +520,6 @@ button {
width: 100%; width: 100%;
} }
#windows {
position: relative;
overflow: hidden;
flex: 1;
}
#windows label { #windows label {
font-size: 14px; font-size: 14px;
} }
@ -553,8 +547,7 @@ button {
border-color: #79838c; border-color: #79838c;
} }
#windows .window:before, #windows .window:before {
#windows .chan:before {
background: #f4f4f4; background: #f4f4f4;
background-image: linear-gradient(#f4f4f4, #ececec); background-image: linear-gradient(#f4f4f4, #ececec);
border-bottom: 1px solid #d7d7d7; border-bottom: 1px solid #d7d7d7;
@ -565,7 +558,6 @@ button {
z-index: 10; z-index: 10;
} }
#windows .chan,
#windows .window { #windows .window {
background: #fff; background: #fff;
bottom: 0; bottom: 0;
@ -574,10 +566,6 @@ button {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
}
#windows .window {
bottom: -44px !important;
overflow-y: auto; overflow-y: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
@ -620,12 +608,32 @@ button {
display: none; display: none;
} }
#chat { #chat-container,
#chat .chan {
position: absolute;
top: 0;
right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
position: absolute; }
right: 0;
top: 0; #windows #chat-container.active {
display: flex;
flex-direction: column;
}
#chat {
position: relative;
overflow: hidden;
flex: 1;
}
#chat .chan {
display: none;
}
#chat .chan.active {
display: block;
} }
#chat, #chat,
@ -634,9 +642,13 @@ button {
line-height: 1.4; line-height: 1.4;
} }
#windows #chat .header {
display: block;
}
#chat .chat, #chat .chat,
#chat .sidebar { #chat .sidebar {
top: 58px; top: 48px;
} }
#chat .chat { #chat .chat {
@ -1202,15 +1214,16 @@ button {
#form { #form {
background: #eee; background: #eee;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
min-height: 48px;
flex: 0 0 auto; flex: 0 0 auto;
padding: 7px; padding: 5px;
} }
#form .input { #windows #form .input {
font: 12px Consolas, Menlo, Monaco, "Lucida Console", "DejaVu Sans Mono", "Courier New", monospace; font: 12px Consolas, Menlo, Monaco, "Lucida Console", "DejaVu Sans Mono", "Courier New", monospace;
border: 1px solid #ddd; border: 1px solid #ddd;
border-radius: 2px; border-radius: 2px;
margin: 0;
padding: 0;
background: white; background: white;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
@ -1222,7 +1235,6 @@ button {
font: inherit; font: inherit;
font-size: 11px; font-size: 11px;
margin: 5px; margin: 5px;
margin-right: 10px;
line-height: 26px; line-height: 26px;
height: 24px; height: 24px;
padding: 0 9px; padding: 0 9px;

View File

@ -55,7 +55,16 @@
</div> </div>
</div> </div>
</div> </div>
<div id="chat"></div> <div id="chat-container" class="window">
<div id="chat"></div>
<form id="form" method="post" action="">
<div class="input">
<label for="input" id="nick"></label>
<textarea id="input" class="mousetrap"></textarea>
<button id="submit" type="submit" title="Send" aria-label="Send message"></button>
</div>
</form>
</div>
<div id="sign-in" class="window"> <div id="sign-in" class="window">
<form class="container" method="post" action=""> <form class="container" method="post" action="">
<div class="row"> <div class="row">
@ -323,13 +332,6 @@
</div> </div>
</div> </div>
</div> </div>
<form id="form" method="post" action="">
<div class="input">
<label for="input" id="nick"></label>
<textarea id="input" class="mousetrap"></textarea>
<button id="submit" type="submit" title="Send" aria-label="Send message"></button>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>

View File

@ -745,7 +745,6 @@ $(function() {
} }
} }
var top = 1;
sidebar.on("click", ".chan, button", function() { sidebar.on("click", ".chan, button", function() {
var self = $(this); var self = $(this);
var target = self.data("target"); var target = self.data("target");
@ -774,7 +773,7 @@ $(function() {
} }
viewport.removeClass("lt"); viewport.removeClass("lt");
var lastActive = $("#windows .active"); var lastActive = $("#windows .chan.active");
lastActive lastActive
.removeClass("active") .removeClass("active")
@ -785,10 +784,11 @@ $(function() {
.find(".unread-marker") .find(".unread-marker")
.appendTo(lastActive.find(".messages")); .appendTo(lastActive.find(".messages"));
$("#chat-container").addClass("active");
var chan = $(target) var chan = $(target)
.addClass("active") .addClass("active")
.trigger("show") .trigger("show");
.css("z-index", top++);
var chanChat = chan.find(".chat"); var chanChat = chan.find(".chat");
if (chanChat.length > 0) { if (chanChat.length > 0) {