refactor(layout): move blur theme flag to config

pull/46/head
kostya.danovsky 2016-05-11 19:35:28 +03:00
parent 1d58c6ff92
commit 7ee5266329
6 changed files with 25 additions and 12 deletions

View File

@ -15,7 +15,7 @@
function baPanel(baPanel) { function baPanel(baPanel) {
return angular.extend({}, baPanel, { return angular.extend({}, baPanel, {
template: function(el, attrs) { template: function(el, attrs) {
var res = '<div class="panel panel-blur full-invisible ' + (attrs.baPanelClass || '') + '" zoom-in ba-panel-blur>'; var res = '<div class="panel panel-blur full-invisible ' + (attrs.baPanelClass || '') + '" zoom-in>';
res += baPanel.template(el, attrs); res += baPanel.template(el, attrs);
res += '</div>'; res += '</div>';
return res; return res;

View File

@ -7,6 +7,8 @@
var IMAGES_ROOT = 'assets/img/'; var IMAGES_ROOT = 'assets/img/';
var blurTheme = false;
var basic = { var basic = {
default: 'rgba(#000000, 0.2)', default: 'rgba(#000000, 0.2)',
defaultText: '#ffffff', defaultText: '#ffffff',
@ -33,6 +35,9 @@
}; };
angular.module('BlurAdmin.theme') angular.module('BlurAdmin.theme')
.constant('layoutTheme', {
blur: blurTheme,
})
.constant('layoutColors', { .constant('layoutColors', {
default: basic.default, default: basic.default,
defaultText: basic.defaultText, defaultText: basic.defaultText,

View File

@ -9,9 +9,11 @@
.run(themeRun); .run(themeRun);
/** @ngInject */ /** @ngInject */
function themeRun($timeout, $rootScope, layoutSizes, layoutPaths, preloader, $q, baSidebarService) { function themeRun($timeout, $rootScope, layoutTheme, layoutPaths, preloader, $q, baSidebarService) {
$rootScope.$isMobile = (/android|webos|iphone|ipad|ipod|blackberry|windows phone/).test(navigator.userAgent.toLowerCase()); $rootScope.$isMobile = (/android|webos|iphone|ipad|ipod|blackberry|windows phone/).test(navigator.userAgent.toLowerCase());
$rootScope.$blurTheme = layoutTheme.blur;
var whatToWait = [ var whatToWait = [
preloader.loadAmCharts(), preloader.loadAmCharts(),
$timeout(3000) $timeout(3000)

View File

@ -24,7 +24,7 @@
<!-- endinject --> <!-- endinject -->
<!-- endbuild --> <!-- endbuild -->
</head> </head>
<body ng-class="{'mobile' : $isMobile}"> <body ng-class="{'mobile' : $isMobile, 'blur-theme': $blurTheme}">
<div class="body-bg"></div> <div class="body-bg"></div>
<main ng-if="$pageFinishedLoading" ng-class="{ 'menu-collapsed': $baSidebarService.isMenuCollapsed() }"> <main ng-if="$pageFinishedLoading" ng-class="{ 'menu-collapsed': $baSidebarService.isMenuCollapsed() }">

View File

@ -15,11 +15,13 @@ html, body {
body { body {
font: 14px/16px $font-family; font: 14px/16px $font-family;
color: $default-text; color: $default-text;
//background-color: $body-bg; background-color: $body-bg;
@include main-background(); &.blur-theme {
@include main-background();
}
} }
&.mobile{ body.mobile{
background: none; background: none;
.body-bg{ .body-bg{
display: block; display: block;
@ -29,7 +31,9 @@ body {
bottom: 0; bottom: 0;
right: 0; right: 0;
background-attachment: inherit; background-attachment: inherit;
//background-color: $body-bg; background-color: $body-bg;
}
&.blur-theme {
@include main-background(); @include main-background();
} }
} }

View File

@ -40,11 +40,13 @@ $panel-heading-font-size: 16px;
} }
} }
.panel.panel-blur { .blur-theme {
$blurredBgUrl: $images-root + 'blur-bg-blurred.jpg'; .panel.panel-blur {
background: url($blurredBgUrl); $blurredBgUrl: $images-root + 'blur-bg-blurred.jpg';
transition: none; background: url($blurredBgUrl);
background-attachment: fixed; transition: none;
background-attachment: fixed;
}
} }
.panel { .panel {