diff --git a/bower.json b/bower.json index e6d1240bc..4be1ede51 100644 --- a/bower.json +++ b/bower.json @@ -15,7 +15,6 @@ "tests" ], "dependencies": { - "AngularHammer": "ryanmullins-angular-hammer#~2.1.10", "Chart.js": "~1.0.2", "Ionicons": "ionicons#~2.0.1", "amcharts": "~3.15.2", @@ -26,6 +25,7 @@ "angular-slimscroll": "~1.1.5", "angular-smart-table": "~2.1.3", "angular-toastr": "~1.5.0", + "angular-touch": "~1.4.6", "angular-ui-sortable": "~0.13.4", "animate.css": "~3.4.0", "bootstrap": "~3.3.5", @@ -34,7 +34,6 @@ "bootstrap-tagsinput": "~0.5.0", "font-awesome": "fontawesome#~4.4.0", "fullcalendar": "~2.4.0", - "hammerjs": "hammer.js#~2.0.4", "highlight": "~8.8.0", "jquery": "~2.1.4", "jquery-ui": "~1.11.4", diff --git a/gulpfile.js b/gulpfile.js index 788d9551b..e095f2554 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -81,6 +81,7 @@ gulp.task('js', function () { 'bower_components/angular/angular.min.js', 'src/assets/js/global-variables.js', 'bower_components/angular-route/angular-route.min.js', + 'bower_components/angular-touch/angular-touch.min.js', 'bower_components/jquery-ui/jquery-ui.min.js', 'bower_components/bootstrap/dist/js/bootstrap.min.js', 'bower_components/highlight/src/highlight.js', @@ -89,7 +90,7 @@ gulp.task('js', function () { 'bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js', 'bower_components/moment/min/moment.min.js', 'bower_components/amcharts/dist/amcharts/amcharts.js', - 'bower_components/amcharts/dist/amcharts/plugins/responsive/responsive.js', + 'bower_components/amcharts/dist/amcharts/plugins/responsive/responsive.min.js', 'bower_components/amcharts/dist/amcharts/serial.js', 'bower_components/amcharts/dist/amcharts/funnel.js', 'bower_components/amcharts/dist/amcharts/pie.js', diff --git a/src/app/app.js b/src/app/app.js index aa458aef3..a52cce3cd 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -3,6 +3,7 @@ var blurAdminApp = angular.module('BlurAdmin', [ 'ui.sortable', 'ngRoute', + 'ngTouch', 'BlurAdmin.dashboard', 'BlurAdmin.buttonsPage', 'BlurAdmin.chartsPage', @@ -16,8 +17,7 @@ var blurAdminApp = angular.module('BlurAdmin', [ 'BlurAdmin.typographyPage', 'toastr', 'smart-table', - 'ui.slimscroll', - 'hmTouchEvents' + 'ui.slimscroll' ]).config(['$routeProvider', 'toastrConfig', function ($routeProvider, toastrConfig) { $routeProvider.otherwise({redirectTo: '/dashboard'}); diff --git a/src/app/common/controllers/mainCtrl.js b/src/app/common/controllers/mainCtrl.js index 018f69fea..db168ee77 100644 --- a/src/app/common/controllers/mainCtrl.js +++ b/src/app/common/controllers/mainCtrl.js @@ -8,4 +8,6 @@ blurAdminApp.controller('mainCtrl', ['$scope', '$timeout', function ($scope, $ti $timeout(function () { pageLoaded = true; }, 4000); + + $scope.isMenuCollapsed = window.innerWidth <= resWidthCollapseSidebar; }]); \ No newline at end of file diff --git a/src/app/components/sidebar/_sidebar.scss b/src/app/components/sidebar/_sidebar.scss index 96548ed04..7f6da256b 100644 --- a/src/app/components/sidebar/_sidebar.scss +++ b/src/app/components/sidebar/_sidebar.scss @@ -116,11 +116,6 @@ a.al-sidebar-list-link { } } -.sidebar-overlap { - background: rgba(0, 0, 0, .75); - @extend .sidebar-full-width; -} - .slimScrollBar, .slimScrollRail { border-radius: 0px !important; width: 4px !important; @@ -157,6 +152,20 @@ a.al-sidebar-list-link { } } +@mixin layout-collapsed() { + .al-main { + margin-left: 70px; + } + + .al-footer { + padding-left: 83px + } + + .back-top { + left: 0; + } +} + @mixin default-sublist() { margin: 0; padding: 0; @@ -299,66 +308,84 @@ a.al-sidebar-list-link { } } -.collapsed-sidebar { - @include layout-collapsed(); - @include sidebar-collapsed(); -} +@mixin sidebar-overlap() { + .al-sidebar { + width: $sidebar-width; + background: rgba(0, 0, 0, .75); + a.al-logo { + display: block; + span { + padding-left: 0; + } + } + a.al-logo-small-rez { + display: none; + } + .fa-angle-down, .fa-angle-up { + opacity: 1; + } -@media (max-width: 1120px) and (min-width: $resXS) { - body { - @include layout-collapsed(); + .al-sidebar-list-block { + display: block; + } + + .al-sidebar-sublist { + @include default-sublist(); + top: auto; + left: auto; + background: none; + width: auto; + overflow: visible; + transition: none; + } + + a.collapse-menu-link { + @include bg-translucent-dark(0.75); + i { + transform: rotate(0deg); + } + } + + .sidebar-hover-elem, .sidebar-select-elem { + left: $sidebar-width - 4; + } + + .search { + width: 162px; + } } - @include sidebar-collapsed(); } -@media (max-width: $resXS) { - @include sidebar-hidden(); - .collapsed-sidebar { - @include sidebar-hidden(); +@media (min-width: 1120px) { + .menu-collapsed { + @include layout-collapsed(); } } -.sidebar-full-width { - width: $sidebar-width; - a.al-logo { - display: block; - span { - padding-left: 0; - } - } - a.al-logo-small-rez { - display: none; - } - .fa-angle-down, .fa-angle-up { - opacity: 1; +@media (min-width: $resXS) { + .menu-collapsed { + @include sidebar-collapsed(); } +} - .al-sidebar-list-block { - display: block; - } +@media (max-width: 1120px) and (min-width: $resXS) { + @include layout-collapsed(); +} - .al-sidebar-sublist { - @include default-sublist(); - top: auto; - left: auto; - background: none; - width: auto; - overflow: visible; - transition: none; +@media (max-width: 1120px) { + .menu-expand { + @include sidebar-overlap(); } +} - a.collapse-menu-link { - @include bg-translucent-dark(0.75); - i { - transform: rotate(0deg); - } +@media (max-width: $resXS) { + .menu-collapsed { + @include sidebar-hidden(); } - - .sidebar-hover-elem, .sidebar-select-elem { - left: $sidebar-width - 4; + .al-main { + margin-left: 0; } - - .search { - width: 162px; + .al-footer { + padding-left: 0; } } \ No newline at end of file diff --git a/src/app/components/sidebar/sidebar.html b/src/app/components/sidebar/sidebar.html index 93f064d55..f75274c82 100644 --- a/src/app/components/sidebar/sidebar.html +++ b/src/app/components/sidebar/sidebar.html @@ -1,16 +1,15 @@ -