Skip to content

Commit

Permalink
fix(sidebar): fix #997
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Zhukov committed Apr 27, 2017
1 parent 7b5dd5e commit 0a3c98e
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 227 deletions.
9 changes: 5 additions & 4 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/normalize.css/normalize.css",
"../node_modules/bootstrap/scss/bootstrap.scss",
"../node_modules/roboto-fontface/css/roboto/sass/roboto-fontface.scss",
"../node_modules/normalize.css/normalize.css",
"../node_modules/font-awesome/scss/font-awesome.scss",
"../node_modules/ionicons/scss/ionicons.scss",
"../node_modules/bootstrap/scss/bootstrap.scss",
"../node_modules/leaflet/dist/leaflet.css",
"../node_modules/chartist/dist/chartist.css",
"../node_modules/fullcalendar/dist/fullcalendar.css",
"app/theme/initial.scss",
"app/theme/theme.scss",
"styles.scss"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/easy-pie-chart/dist/jquery.easypiechart.js",
"../node_modules/jquery-slimscroll/jquery.slimscroll.js",
"../node_modules/tether/dist/js/tether.js",
"../node_modules/easy-pie-chart/dist/jquery.easypiechart.js"
"../node_modules/bootstrap/dist/js/bootstrap.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
Expand Down
123 changes: 123 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
@import './theme/sass/conf/conf';
@import './theme/components/baSidebar/baSidebar';

:host /deep/ {
@mixin layout-collapsed() {
.al-main {
margin-left: 50px;
}
.al-footer {
padding-left: 83px;
}
}

@mixin sidebar-collapsed() {
.al-sidebar {
width: 52px;

.fa-angle-down, .fa-angle-up {
opacity: 0;
}

.al-sidebar-sublist {
position: absolute;
top: -1px;
left: 52px;
@include bg-translucent-dark(0.8);
width: 0;
display: block;
overflow: hidden;
transition: width 0.5s ease;
&.slide-right {
width: 135px;
}
&::before {
display: none;
}
li {
&::before {
display: none;
}
a {
padding-left: 18px;
padding-right: 18px;
min-width: 130px;
white-space: nowrap;
}
}
}

.sidebar-hover-elem, .sidebar-select-elem {
left: 48px;
}
}
}

@mixin sidebar-overlap() {
.al-sidebar {
width: $sidebar-width;
@include bg-translucent-dark(0.75);
transition: width 0.5s ease;

.fa-angle-down, .fa-angle-up {
opacity: 1;
}

.al-sidebar-sublist {
@include default-sublist();
top: auto;
left: auto;
background: none;
width: auto;
overflow: visible;
transition: none;
}

.sidebar-hover-elem, .sidebar-select-elem {
left: $sidebar-width - 4;
transition: left 0.5s ease;
}
}
}

@mixin sidebar-hidden() {
.al-sidebar {
width: 0;
}
.sidebar-hover-elem, .sidebar-select-elem {
display: none;
}
}

@media (min-width: 1200px) {
.menu-collapsed {
@include layout-collapsed();
}
}

@media (max-width: 1200px) and (min-width: $resXS) {
@include layout-collapsed();
}

@media (min-width: $resXS + 1) {
.menu-collapsed {
@include sidebar-collapsed();
}
}

@media (max-width: 1200px) {
@include sidebar-overlap();
}

@media (max-width: $resXS) {
.menu-collapsed {
@include sidebar-hidden();
}
.al-main {
margin-left: 0;
}
.al-footer {
padding-left: 0;
}
}
}
42 changes: 0 additions & 42 deletions src/app/app.component.spec.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { layoutPaths } from './theme/theme.constants';
*/
@Component({
selector: 'app',
styleUrls: ['./app.component.scss'],
template: `
<main [ngClass]="{'menu-collapsed': isMenuCollapsed}" baThemeRun>
<main [class.menu-collapsed]="isMenuCollapsed" baThemeRun>
<div class="additional-bg"></div>
<router-outlet></router-outlet>
</main>
Expand Down
2 changes: 0 additions & 2 deletions src/app/app.scss

This file was deleted.

Loading

0 comments on commit 0a3c98e

Please sign in to comment.