Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(backdrop): use fixed position for global backdrops.
Browse files Browse the repository at this point in the history
Set backdrop `position:fixed` when the parent is BODY to give it a position based off the body viewport.

Closes #2831.
  • Loading branch information
ThomasBurleson committed Oct 29, 2015
1 parent 36aa6bc commit a8537e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/backdrop/backdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ angular
// so let's wait until $animate is done...
var parent = element.parent()[0];
if (parent) {

if ( parent.nodeName == 'BODY' ) {
element.css({position : 'fixed'});
}

var styles = $window.getComputedStyle(parent);
if (styles.position == 'static') {
// backdrop uses position:absolute and will not work properly with parent position:static (default)
Expand Down

0 comments on commit a8537e6

Please sign in to comment.