From 971d9a839b95d7942910d55c173ac62c04ae57b5 Mon Sep 17 00:00:00 2001 From: xtang Date: Sat, 26 Jul 2014 14:47:58 +0800 Subject: [PATCH 1/2] Always select container when config.container is set --- modal.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modal.js b/modal.js index 6c295df..6761c01 100644 --- a/modal.js +++ b/modal.js @@ -19,6 +19,7 @@ factory('btfModal', function ($animate, $compile, $rootScope, $controller, $q, $ controllerAs = config.controllerAs, container = angular.element(config.container || document.body), element = null, + container = angular.element(document.body), html, scope; @@ -48,6 +49,9 @@ factory('btfModal', function ($animate, $compile, $rootScope, $controller, $q, $ if (element.length === 0) { throw new Error('The template contains no elements; you need to wrap text nodes') } + if (config.container) { + container = angular.element(config.container); + } $animate.enter(element, container); scope = $rootScope.$new(); if (locals) { From 694fbda2aa03c85002670a55ec86ef7f18ca10a6 Mon Sep 17 00:00:00 2001 From: xtang Date: Wed, 30 Jul 2014 10:50:27 +0800 Subject: [PATCH 2/2] Remove duplicate container assignment --- modal.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modal.js b/modal.js index 6761c01..fe678ed 100644 --- a/modal.js +++ b/modal.js @@ -17,7 +17,6 @@ factory('btfModal', function ($animate, $compile, $rootScope, $controller, $q, $ var template = config.template, controller = config.controller || angular.noop, controllerAs = config.controllerAs, - container = angular.element(config.container || document.body), element = null, container = angular.element(document.body), html,