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) {
return angular.extend({}, baPanel, {
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 += '</div>';
return res;

View File

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

View File

@ -9,9 +9,11 @@
.run(themeRun);
/** @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.$blurTheme = layoutTheme.blur;
var whatToWait = [
preloader.loadAmCharts(),
$timeout(3000)

View File

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

View File

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

View File

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