settings: Make settings overlay more responsive.

This doesn't completely fix settings responsiveness, but it's a big
step along the way.  Outstanding issues include:

1. When switching tabs from settings to organization, it will launch
the first item which is more annoying in this view since it brings you
into that tab. Haven’t decided on an elegant solution to this yet.

2. Sidebar scrolling doesn’t work. I have to restructure how the top
section and bottom sections of content are displayed to fix this.
Likely by enforcing min-height of 100% - bottom height on the top piece.

3. Most of it is actually reasonably responsive but some isn’t, and
should be fixed on a case-by-case.
This commit is contained in:
Brock Whittaker 2017-05-05 11:38:15 -07:00 committed by Tim Abbott
parent 15c6d683a9
commit c8902d5d71
5 changed files with 67 additions and 15 deletions

View File

@ -596,8 +596,16 @@ $(function () {
var $this = $(this); var $this = $(this);
$("#settings_overlay_container .sidebar li").removeClass("active no-border"); $("#settings_overlay_container .sidebar li").removeClass("active no-border");
$this.addClass("active"); $this.addClass("active").prev().addClass("no-border");
$this.prev().addClass("no-border");
var $settings_overlay_container = $("#settings_overlay_container");
$settings_overlay_container.find(".right").addClass("show");
$settings_overlay_container.find(".settings-header.mobile").addClass("slide-left");
});
$(".settings-header.mobile .icon-vector-chevron-left").on("click", function () {
$("#settings_page").find(".right").removeClass("show");
$(this).parent().removeClass("slide-left");
}); });
$("#settings_overlay_container .sidebar").on("click", "li[data-section]", function () { $("#settings_overlay_container .sidebar").on("click", "li[data-section]", function () {

View File

@ -795,6 +795,18 @@ input[type=checkbox].inline-block {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
#settings_page .settings-header.mobile {
display: none;
border-bottom: 1px solid #ddd;
}
.settings-header.mobile .icon-vector-chevron-left {
float: left;
position: relative;
top: 14px;
left: 10px;
}
#settings_page .content-wrapper #settings_content { #settings_page .content-wrapper #settings_content {
position: relative; position: relative;
width: 100%; width: 100%;
@ -802,6 +814,7 @@ input[type=checkbox].inline-block {
float: left; float: left;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden;
} }
#settings_page .table-striped thead th { #settings_page .table-striped thead th {
@ -1064,6 +1077,24 @@ input[type=text]#settings_search {
} }
} }
@media (max-width: 700px) {
#settings_page .settings-header.mobile {
display: block;
}
#settings_page .content-wrapper .settings-header {
display: none;
}
#settings_page .content-wrapper #settings_content {
height: 100%;
}
#settings_page .content-wrapper.right {
top: 47px;
}
}
@media (max-width: 953px) { @media (max-width: 953px) {
#settings_content .warning { #settings_content .warning {
display: none; display: none;

View File

@ -430,9 +430,8 @@ form#add_new_subscription {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
.subscriptions-header .icon-vector-chevron-left { .subscriptions-header .icon-vector-chevron-left,
display: none; #settings_overlay_container .settings-header.mobile .icon-vector-chevron-left {
position: relative; position: relative;
transform: translate(-50px, 0px); transform: translate(-50px, 0px);
opacity: 0; opacity: 0;
@ -446,7 +445,8 @@ form#add_new_subscription {
transition: all 0.3s ease; transition: all 0.3s ease;
} }
.subscriptions-header.slide-left .icon-vector-chevron-left { .subscriptions-header.slide-left .icon-vector-chevron-left,
#settings_overlay_container .settings-header.mobile.slide-left .icon-vector-chevron-left {
transform: translate(-0px, 0px); transform: translate(-0px, 0px);
opacity: 1; opacity: 1;
} }
@ -956,7 +956,9 @@ form#add_new_subscription {
} }
#subscription_overlay .left, #subscription_overlay .left,
#subscription_overlay .right { #subscription_overlay .right,
#settings_page .left,
#settings_page .right {
position: absolute; position: absolute;
display: block; display: block;
margin: 0; margin: 0;
@ -974,7 +976,8 @@ form#add_new_subscription {
text-align: left; text-align: left;
} }
#subscription_overlay .right { #subscription_overlay .right,
#settings_page .right {
position: absolute; position: absolute;
left: 101%; left: 101%;
@ -987,7 +990,8 @@ form#add_new_subscription {
z-index: 10; z-index: 10;
} }
#subscription_overlay .right.show { #subscription_overlay .right.show,
#settings_page .right.show {
left: 0%; left: 0%;
} }

View File

@ -1,5 +1,13 @@
<div id="settings_page" class="new-style overlay-content"> <div id="settings_page" class="new-style overlay-content">
<div class="sidebar"> <div class="settings-header mobile">
<div class="icon-vector-chevron-left"></div>
<h1>{{ _('Settings') }}</h1>
<div class="exit">
<span class="exit-sign">&times;</span>
</div>
<div class="clear-float"></div>
</div>
<div class="sidebar left">
<div class="sidebar-list dark-grey small-text"> <div class="sidebar-list dark-grey small-text">
<div class="center tab-container"></div> <div class="center tab-container"></div>
<ul class="settings-list"> <ul class="settings-list">
@ -88,7 +96,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="content-wrapper"> <div class="content-wrapper right">
<div class="settings-header"> <div class="settings-header">
<h1>{{ _('Settings') }}</h1> <h1>{{ _('Settings') }}</h1>
<div class="exit"> <div class="exit">

View File

@ -14,21 +14,22 @@ GENERIC_KEYWORDS = [
'disabled', 'disabled',
'error', 'error',
'expanded', 'expanded',
'fade-out',
'first',
'hide', 'hide',
'in', 'in',
'show', 'show',
'notdisplayed', 'notdisplayed',
'popover', 'popover',
'no-border', 'no-border',
'second',
'selected',
'slide-left',
'success', 'success',
'text-error', 'text-error',
'warning', 'warning',
'zoom-in', # TODO: clean these up, they are confusing 'zoom-in', # TODO: clean these up, they are confusing
'zoom-out', 'zoom-out',
'first',
'second',
'selected',
'fade-out',
] ]
def raise_error(fn, i, line): def raise_error(fn, i, line):