mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-15 21:29:33 +08:00
Remove some dead code, make sidebar toggle animated
This commit is contained in:
parent
b86edf20a5
commit
b3ae1d8fa6
6 changed files with 21 additions and 81 deletions
|
|
@ -170,7 +170,7 @@ function initializeEdit() {
|
||||||
|
|
||||||
// Hide sidebar & also its toggle button
|
// Hide sidebar & also its toggle button
|
||||||
$("#wrapper").addClass("hidden2");
|
$("#wrapper").addClass("hidden2");
|
||||||
$("#wrapper").find(".sidebar-header-toggle").hide();
|
$("#sideBarButton").addClass("hidden2");
|
||||||
$(".navbar-secondary").addClass("navbar-without-sidebar");
|
$(".navbar-secondary").addClass("navbar-without-sidebar");
|
||||||
|
|
||||||
// Also, hide zoom levels button group
|
// Also, hide zoom levels button group
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@
|
||||||
global.SideBarToggle = (function() {
|
global.SideBarToggle = (function() {
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
$('#sideBarLeft').show();
|
|
||||||
$('#sideBarRight').hide();
|
|
||||||
$('#sidebar-wrapper').show(
|
$('#sidebar-wrapper').show(
|
||||||
'slide', { direction: 'right', easing: 'linear' }, 400
|
'slide', { direction: 'right', easing: 'linear' }, 400
|
||||||
);
|
);
|
||||||
|
|
@ -16,8 +14,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide() {
|
function hide() {
|
||||||
$('#sideBarLeft').hide();
|
|
||||||
$('#sideBarRight').show();
|
|
||||||
$('#sidebar-wrapper').hide(
|
$('#sidebar-wrapper').hide(
|
||||||
'slide', { direction: 'left', easing: 'linear'}, 400
|
'slide', { direction: 'left', easing: 'linear'}, 400
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -37,51 +37,6 @@ $toggle-btn-size: 50px;
|
||||||
#slide-panel {
|
#slide-panel {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.sidebar-header {
|
|
||||||
height: $toggle-btn-size;
|
|
||||||
background: $brand-primary;
|
|
||||||
border-bottom: 2px solid darken($brand-primary, 10%);
|
|
||||||
|
|
||||||
.sidebar-header-title {
|
|
||||||
width: inherit;
|
|
||||||
color: $color-white;
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 15px;
|
|
||||||
margin-top: 6px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
max-width: ($wrapper-width - $toggle-btn-size);
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
opacity: 1;
|
|
||||||
|
|
||||||
// Animations
|
|
||||||
@include transition(opacity 0.5s ease);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-header-toggle {
|
|
||||||
height: $toggle-btn-size;
|
|
||||||
width: $toggle-btn-size;
|
|
||||||
margin-left: ($wrapper-width - $toggle-btn-size);
|
|
||||||
margin-top: -$toggle-btn-size;
|
|
||||||
font-size: $font-size-h3;
|
|
||||||
background: $brand-primary;
|
|
||||||
border-left: 2px solid darken($brand-primary, 10%);
|
|
||||||
border-bottom: 2px solid darken($brand-primary, 10%);
|
|
||||||
|
|
||||||
// Animations
|
|
||||||
@include transition(margin-left 0.5s ease);
|
|
||||||
|
|
||||||
span {
|
|
||||||
margin: 10px;
|
|
||||||
color: $color-white;
|
|
||||||
|
|
||||||
// Animations
|
|
||||||
@include rotate-animation(0.5s, 180deg);
|
|
||||||
@include transition(color 0.5s ease);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree {
|
.tree {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
@ -103,29 +58,6 @@ $toggle-btn-size: 50px;
|
||||||
width: 0;
|
width: 0;
|
||||||
|
|
||||||
#slide-panel {
|
#slide-panel {
|
||||||
.sidebar-header .sidebar-header-title {
|
|
||||||
width: 0;
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
@include transition(width 0.5s ease);
|
|
||||||
@include transition(opacity 0.5s ease);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-header-toggle {
|
|
||||||
margin-left: 0;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
|
|
||||||
@include transition(margin-left 0.5s ease);
|
|
||||||
|
|
||||||
span {
|
|
||||||
color: darken($brand-primary, 10%);
|
|
||||||
|
|
||||||
@include rotate-animation(0.5s, 0deg);
|
|
||||||
@include transition(color 0.5s ease);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree {
|
.tree {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,22 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sideBarButton > span {
|
||||||
|
@include rotate-animation(0.5s, 0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
#sideBarButton[data-shown] > span {
|
||||||
|
@include rotate-animation(0.5s, 180deg);
|
||||||
|
}
|
||||||
|
|
||||||
#sideBarButton:hover {
|
#sideBarButton:hover {
|
||||||
background-color: $color-concrete;
|
background-color: $color-concrete;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sideBarButton.hidden2 {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media(max-height:510px) {
|
@media(max-height:510px) {
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,10 @@ module LeftMenuBarHelper
|
||||||
def activities_are_selected?
|
def activities_are_selected?
|
||||||
controller_name == 'activities'
|
controller_name == 'activities'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def navigation_sidebar_shown?
|
||||||
|
projects_are_selected? ||
|
||||||
|
repositories_are_selected? ||
|
||||||
|
settings_are_selected?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -65,21 +65,15 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<!-- arrow for opening/closing -->
|
<!-- arrow for opening/closing -->
|
||||||
<li class="text-center"
|
<li class="text-center <%= navigation_sidebar_shown? ? '' : 'hidden2' %>"
|
||||||
style="padding: 5px;"
|
style="padding: 5px;"
|
||||||
id="sideBarButton"
|
id="sideBarButton"
|
||||||
data-shown=""
|
data-shown=""
|
||||||
onclick="SideBarToggle.toggle()"
|
onclick="SideBarToggle.toggle()"
|
||||||
>
|
>
|
||||||
<span id="sideBarLeft"
|
<span class="fas fa-chevron-right"
|
||||||
class="fas fa-chevron-left"
|
|
||||||
aria-hidden="false"
|
aria-hidden="false"
|
||||||
></span>
|
></span>
|
||||||
<span id="sideBarRight"
|
|
||||||
class="fas fa-chevron-right"
|
|
||||||
aria-hidden="true"
|
|
||||||
style="display:none;"
|
|
||||||
></span>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue