From 85274b90b26fa94ee568fc671feee31af2663648 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 1 Mar 2016 18:09:11 +0300 Subject: [PATCH] refactor(blurFeature): use atachment fixed --- src/app/theme/components/baPanel/baPanelBlur.directive.js | 4 +--- src/app/theme/components/baPanel/baPanelBlurHelper.service.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/theme/components/baPanel/baPanelBlur.directive.js b/src/app/theme/components/baPanel/baPanelBlur.directive.js index 890bfc5..ad340a5 100644 --- a/src/app/theme/components/baPanel/baPanelBlur.directive.js +++ b/src/app/theme/components/baPanel/baPanelBlur.directive.js @@ -26,7 +26,6 @@ baPanelBlurHelper.bodyBgLoad().then(function() { setTimeout(recalculatePanelStyle); }); - $document.on('scroll', recalculatePanelStyle); $window.addEventListener('resize', recalculatePanelStyle); $scope.$on('$destroy', function() { @@ -37,10 +36,9 @@ if (!bodyBgSize) { return; } - var position = elem[0].getBoundingClientRect(); elem.css({ backgroundSize: Math.round(bodyBgSize.width) + 'px ' + Math.round(bodyBgSize.height) + 'px', - backgroundPosition: Math.floor(-position.left + bodyBgSize.positionX) + 'px ' + Math.floor(-position.top + bodyBgSize.positionY) + 'px' + backgroundPosition: Math.floor(bodyBgSize.positionX) + 'px ' + Math.floor(bodyBgSize.positionY) + 'px' }); } diff --git a/src/app/theme/components/baPanel/baPanelBlurHelper.service.js b/src/app/theme/components/baPanel/baPanelBlurHelper.service.js index c0f7984..716e47c 100644 --- a/src/app/theme/components/baPanel/baPanelBlurHelper.service.js +++ b/src/app/theme/components/baPanel/baPanelBlurHelper.service.js @@ -39,7 +39,7 @@ finalWidth = elemW; finalHeight = (elemW * imgRatio); } - return { width: finalWidth, height: finalHeight, positionX: (elemW - finalWidth) / 2, positionY: (elemH - finalHeight) / 2 }; + return { width: finalWidth, height: finalHeight, positionX: (elemW - finalWidth)/2, positionY: (elemH - finalHeight)/2}; }; }