Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(modal): Grab reference to body when it is needed in lieu of when …
Browse files Browse the repository at this point in the history
…the factory is created
  • Loading branch information
tritonrc authored and pkozlowski-opensource committed Dec 20, 2013
1 parent 2db1ba5 commit dd415a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modal/modal.js
Expand Up @@ -106,7 +106,6 @@ angular.module('ui.bootstrap.modal', [])

var backdropjqLiteEl, backdropDomEl;
var backdropScope = $rootScope.$new(true);
var body = $document.find('body').eq(0);
var openedWindows = $$stackedMap.createNew();
var $modalStack = {};

Expand Down Expand Up @@ -166,7 +165,9 @@ angular.module('ui.bootstrap.modal', [])
backdrop: modal.backdrop,
keyboard: modal.keyboard
});


var body = $document.find('body').eq(0);

if (backdropIndex() >= 0 && !backdropDomEl) {
backdropjqLiteEl = angular.element('<div modal-backdrop></div>');
backdropDomEl = $compile(backdropjqLiteEl)(backdropScope);
Expand Down

0 comments on commit dd415a9

Please sign in to comment.