Fix sidebar in responsive mode

This commit is contained in:
JC Brand 2018-01-26 20:50:11 +01:00
parent b5a43f8177
commit 53adebb780
10 changed files with 57 additions and 44 deletions

View File

@ -4803,10 +4803,9 @@
#converse-embedded-chat .sidebar, #converse-embedded-chat .sidebar,
#conversejs .sidebar { #conversejs .sidebar {
display: none; display: none;
position: absolute;
width: 50px; width: 50px;
height: 100vh; height: 100vh;
padding: 10px 0; padding: 1rem 0;
background-color: #578EA9; background-color: #578EA9;
color: white; color: white;
text-align: center; } text-align: center; }
@ -5604,8 +5603,14 @@
left: 0; } left: 0; }
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
#conversejs > .row {
flex-direction: row-reverse; }
#conversejs #login-dialog .pure-form.converse-form { #conversejs #login-dialog .pure-form.converse-form {
padding: 3em 2em 3em; } padding: 3em 2em 3em; }
#conversejs .sidebar {
display: block; }
#conversejs .chatbox {
width: calc(100% - 50px); }
#conversejs .chatbox .chat-body .chat-message .chat-msg-author { #conversejs .chatbox .chat-body .chat-message .chat-msg-author {
white-space: normal; } white-space: normal; }
#conversejs .chatbox .row .box-flyout { #conversejs .chatbox .row .box-flyout {
@ -6036,12 +6041,11 @@
#conversejs #controlbox #users { #conversejs #controlbox #users {
position: absolute; position: absolute;
top: 0; top: 0;
left: 50px; display: none; }
display: none;
width: calc(100% - 50px); }
#conversejs #controlbox #users.controlbox-pane { #conversejs #controlbox #users.controlbox-pane {
height: 100vh; } height: 100vh;
#conversejs.sidebar-open > .chatbox:not(#controlbox) { width: 100%; }
#conversejs.sidebar-open .chatbox:not(#controlbox) {
display: none; } display: none; }
#conversejs.sidebar-open #controlbox #users { #conversejs.sidebar-open #controlbox #users {
display: block; } } display: block; } }

View File

@ -4803,10 +4803,9 @@
#converse-embedded-chat .sidebar, #converse-embedded-chat .sidebar,
#conversejs .sidebar { #conversejs .sidebar {
display: none; display: none;
position: absolute;
width: 50px; width: 50px;
height: 100vh; height: 100vh;
padding: 10px 0; padding: 1rem 0;
background-color: #578EA9; background-color: #578EA9;
color: white; color: white;
text-align: center; } text-align: center; }
@ -5660,8 +5659,14 @@ body {
left: 0; } left: 0; }
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
#conversejs > .row {
flex-direction: row-reverse; }
#conversejs #login-dialog .pure-form.converse-form { #conversejs #login-dialog .pure-form.converse-form {
padding: 3em 2em 3em; } padding: 3em 2em 3em; }
#conversejs .sidebar {
display: block; }
#conversejs .chatbox {
width: calc(100% - 50px); }
#conversejs .chatbox .chat-body .chat-message .chat-msg-author { #conversejs .chatbox .chat-body .chat-message .chat-msg-author {
white-space: normal; } white-space: normal; }
#conversejs .chatbox .row .box-flyout { #conversejs .chatbox .row .box-flyout {
@ -5728,7 +5733,7 @@ body {
padding-right: 10px; } padding-right: 10px; }
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
#conversejs.fullscreen > .chatbox { #conversejs.fullscreen .chatbox {
width: calc(100% - 50px); } width: calc(100% - 50px); }
#conversejs.fullscreen .chatbox .row { #conversejs.fullscreen .chatbox .row {
width: calc(100% - 50px); } } width: calc(100% - 50px); } }
@ -6110,12 +6115,11 @@ body {
#conversejs #controlbox #users { #conversejs #controlbox #users {
position: absolute; position: absolute;
top: 0; top: 0;
left: 50px; display: none; }
display: none;
width: calc(100% - 50px); }
#conversejs #controlbox #users.controlbox-pane { #conversejs #controlbox #users.controlbox-pane {
height: 100vh; } height: 100vh;
#conversejs.sidebar-open > .chatbox:not(#controlbox) { width: 100%; }
#conversejs.sidebar-open .chatbox:not(#controlbox) {
display: none; } display: none; }
#conversejs.sidebar-open #controlbox #users { #conversejs.sidebar-open #controlbox #users {
display: block; } } display: block; } }

View File

@ -10,11 +10,11 @@
<body> <body>
<div id="conversejs" class="fullscreen"> <div id="conversejs" class="fullscreen">
<div class="sidebar"></div>
<div class="row no-gutters"> <div class="row no-gutters">
<div id="controlbox" class="chatbox col-xl-2 col-md-3"> <div id="controlbox" class="chatbox col-xl-2 col-md-3">
<div class="flyout box-flyout"> <div class="flyout box-flyout">
<div class="controlbox-panes"> <div class="controlbox-panes">
<div class="sidebar"></div>
<div id="users" class="controlbox-pane"></div> <div id="users" class="controlbox-pane"></div>
</div> </div>
</div> </div>

View File

@ -10,11 +10,11 @@
<body> <body>
<div id="conversejs" class="fullscreen"> <div id="conversejs" class="fullscreen">
<div class="sidebar"></div>
<div class="row no-gutters"> <div class="row no-gutters">
<div id="controlbox" class="chatbox col-xl-2 col-md-3"> <div id="controlbox" class="chatbox col-xl-2 col-md-3">
<div class="flyout box-flyout"> <div class="flyout box-flyout">
<div class="controlbox-panes"> <div class="controlbox-panes">
<div class="sidebar"></div>
<div id="users" class="controlbox-pane"></div> <div id="users" class="controlbox-pane"></div>
</div> </div>
</div> </div>

View File

@ -16,7 +16,7 @@ const Sidebar = Backbone.NativeView.extend({
if (_.includes(converse_el.classList, 'sidebar-open')) { if (_.includes(converse_el.classList, 'sidebar-open')) {
converse_el.classList.remove('sidebar-open'); converse_el.classList.remove('sidebar-open');
hamburger.classList.remove('fa-times'); hamburger.classList.remove('fa-times');
hamburger.classList.remove('fa-bars'); hamburger.classList.add('fa-bars');
} else { } else {
converse_el.classList.add('sidebar-open'); converse_el.classList.add('sidebar-open');
hamburger.classList.remove('fa-bars'); hamburger.classList.remove('fa-bars');

View File

@ -438,12 +438,23 @@
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
#conversejs { #conversejs {
> .row {
flex-direction: row-reverse;
}
#login-dialog { #login-dialog {
.pure-form.converse-form { .pure-form.converse-form {
padding: 3em 2em 3em; padding: 3em 2em 3em;
} }
} }
.sidebar {
display: block;
}
.chatbox { .chatbox {
width: calc(100% - 50px);
.chat-body { .chat-body {
.chat-message { .chat-message {
.chat-msg-author { .chat-msg-author {

View File

@ -522,19 +522,17 @@
#users { #users {
position: absolute; position: absolute;
top: 0; top: 0;
left: 50px;
display: none; display: none;
width: calc(100% - 50px);
&.controlbox-pane { &.controlbox-pane {
height: 100vh; height: 100vh;
width: 100%;
} }
} }
} }
&.sidebar-open { &.sidebar-open {
> .chatbox:not(#controlbox) { .chatbox:not(#controlbox) {
display: none; display: none;
} }
#controlbox { #controlbox {

View File

@ -54,10 +54,9 @@
.sidebar { .sidebar {
display: none; display: none;
position: absolute;
width: 50px; width: 50px;
height: 100vh; height: 100vh;
padding: 10px 0; padding: 1rem 0;
background-color: $controlbox-head-color; background-color: $controlbox-head-color;
color: white; color: white;
text-align: center; text-align: center;

View File

@ -88,10 +88,8 @@
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
#conversejs.fullscreen { #conversejs.fullscreen {
> .chatbox {
width: calc(100% - 50px);
}
.chatbox { .chatbox {
width: calc(100% - 50px);
.row { .row {
width: calc(100% - 50px); width: calc(100% - 50px);
} }

View File

@ -1,5 +1,4 @@
#conversejs.fullscreen { #conversejs.fullscreen {
#controlbox { #controlbox {
margin: 0; margin: 0;