Skip to content

Commit

Permalink
Merge pull request thelounge#465 from thelounge/PR/fix-textarea
Browse files Browse the repository at this point in the history
Fix window layout a bit
  • Loading branch information
astorije authored Jul 6, 2016
2 parents 7e24b98 + d1cc554 commit 19c1839
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 34 deletions.
56 changes: 34 additions & 22 deletions client/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,6 @@ button {
width: 100%;
}

#windows {
position: relative;
overflow: hidden;
flex: 1;
}

#windows label {
font-size: 14px;
}
Expand Down Expand Up @@ -553,8 +547,7 @@ button {
border-color: #79838c;
}

#windows .window:before,
#windows .chan:before {
#windows .window:before {
background: #f4f4f4;
background-image: linear-gradient(#f4f4f4, #ececec);
border-bottom: 1px solid #d7d7d7;
Expand All @@ -565,7 +558,6 @@ button {
z-index: 10;
}

#windows .chan,
#windows .window {
background: #fff;
bottom: 0;
Expand All @@ -574,10 +566,6 @@ button {
position: absolute;
right: 0;
top: 0;
}

#windows .window {
bottom: -44px !important;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
Expand Down Expand Up @@ -620,12 +608,32 @@ button {
display: none;
}

#chat {
bottom: 0;
left: 0;
#chat-container,
#chat .chan {
position: absolute;
right: 0;
top: 0;
right: 0;
bottom: 0;
left: 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,
Expand All @@ -634,9 +642,13 @@ button {
line-height: 1.4;
}

#windows #chat .header {
display: block;
}

#chat .chat,
#chat .sidebar {
top: 58px;
top: 48px;
}

#chat .chat {
Expand Down Expand Up @@ -1202,15 +1214,16 @@ button {
#form {
background: #eee;
border-top: 1px solid #ddd;
min-height: 48px;
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;
border: 1px solid #ddd;
border-radius: 2px;
margin: 0;
padding: 0;
background: white;
display: flex;
align-items: flex-end;
Expand All @@ -1222,7 +1235,6 @@ button {
font: inherit;
font-size: 11px;
margin: 5px;
margin-right: 10px;
line-height: 26px;
height: 24px;
padding: 0 9px;
Expand Down
18 changes: 10 additions & 8 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ <h1 class="title">The Lounge is loading…</h1>
</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">
<form class="container" method="post" action="">
<div class="row">
Expand Down Expand Up @@ -323,13 +332,6 @@ <h2>About The Lounge</h2>
</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>
Expand Down
8 changes: 4 additions & 4 deletions client/js/lounge.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,6 @@ $(function() {
}
}

var top = 1;
sidebar.on("click", ".chan, button", function() {
var self = $(this);
var target = self.data("target");
Expand Down Expand Up @@ -774,7 +773,7 @@ $(function() {
}

viewport.removeClass("lt");
var lastActive = $("#windows .active");
var lastActive = $("#windows .chan.active");

lastActive
.removeClass("active")
Expand All @@ -785,10 +784,11 @@ $(function() {
.find(".unread-marker")
.appendTo(lastActive.find(".messages"));

$("#chat-container").addClass("active");

var chan = $(target)
.addClass("active")
.trigger("show")
.css("z-index", top++);
.trigger("show");

var chanChat = chan.find(".chat");
if (chanChat.length > 0) {
Expand Down

0 comments on commit 19c1839

Please sign in to comment.