Skip to content

Commit

Permalink
refactor(blurFeature): use atachment fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaSkywalker committed Mar 1, 2016
1 parent 817e19e commit 85274b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/app/theme/components/baPanel/baPanelBlur.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
baPanelBlurHelper.bodyBgLoad().then(function() {
setTimeout(recalculatePanelStyle);
});
$document.on('scroll', recalculatePanelStyle);
$window.addEventListener('resize', recalculatePanelStyle);

$scope.$on('$destroy', function() {
Expand All @@ -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'
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};
};
}

Expand Down

0 comments on commit 85274b9

Please sign in to comment.