diff --git a/src/app/theme/components/baPanel/baPanelBlur.directive.js b/src/app/theme/components/baPanel/baPanelBlur.directive.js index ad340a5..c3bf907 100644 --- a/src/app/theme/components/baPanel/baPanelBlur.directive.js +++ b/src/app/theme/components/baPanel/baPanelBlur.directive.js @@ -9,7 +9,7 @@ .directive('baPanelBlur', baPanelBlur); /** @ngInject */ - function baPanelBlur(baPanelBlurHelper, $window, $document) { + function baPanelBlur(baPanelBlurHelper, $window, $rootScope) { var bodyBgSize; baPanelBlurHelper.bodyBgLoad().then(function() { @@ -23,14 +23,16 @@ return { restrict: 'A', link: function($scope, elem) { - baPanelBlurHelper.bodyBgLoad().then(function() { - setTimeout(recalculatePanelStyle); - }); - $window.addEventListener('resize', recalculatePanelStyle); + if(!$rootScope.$isMobile) { + baPanelBlurHelper.bodyBgLoad().then(function () { + setTimeout(recalculatePanelStyle); + }); + $window.addEventListener('resize', recalculatePanelStyle); - $scope.$on('$destroy', function() { - $window.removeEventListener('resize', recalculatePanelStyle); - }); + $scope.$on('$destroy', function () { + $window.removeEventListener('resize', recalculatePanelStyle); + }); + } function recalculatePanelStyle() { if (!bodyBgSize) { diff --git a/src/app/theme/theme.run.js b/src/app/theme/theme.run.js index b9e2ef6..014faaa 100644 --- a/src/app/theme/theme.run.js +++ b/src/app/theme/theme.run.js @@ -6,22 +6,30 @@ 'use strict'; angular.module('BlurAdmin.theme') - .run(themeRun); + .run(themeRun); /** @ngInject */ function themeRun($timeout, $rootScope, layoutSizes, layoutPaths, preloader, $q) { - $q.all([ - preloader.loadImg(layoutPaths.images.root + 'blur-bg.jpg'), - preloader.loadImg(layoutPaths.images.root + 'blur-bg-blurred.jpg'), + $rootScope.$isMobile = (/android|webos|iphone|ipad|ipod|blackberry|windows phone/).test(navigator.userAgent.toLowerCase()); + var whatToWait = [ preloader.loadAmCharts(), $timeout(3000) - ]).then(function(){ - $rootScope.$pageFinishedLoading = true; + ]; + + if ($rootScope.$isMobile) { + whatToWait.unshift(preloader.loadImg(layoutPaths.images.root + 'blur-bg-mobile.jpg')); + } else { + whatToWait.unshift(preloader.loadImg(layoutPaths.images.root + 'blur-bg.jpg')); + whatToWait.unshift(preloader.loadImg(layoutPaths.images.root + 'blur-bg-blurred.jpg')); + } + + $q.all(whatToWait).then(function () { + $rootScope.$pageFinishedLoading = true; }); $timeout(function () { - if(!$rootScope.$pageFinishedLoading){ + if (!$rootScope.$pageFinishedLoading) { $rootScope.$pageFinishedLoading = true; } }, 7000); diff --git a/src/index.html b/src/index.html index 96dcc32..1163c71 100644 --- a/src/index.html +++ b/src/index.html @@ -24,7 +24,7 @@ -
+