diff --git a/src/modal/modal.js b/src/modal/modal.js index 5428b44ca3..57ab91b0ba 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -81,23 +81,6 @@ angular.module('ui.bootstrap.modal', []) }; }]) - .directive('modalWindow', ['$timeout', function ($timeout) { - return { - restrict: 'EA', - replace: true, - link: function (scope, element, attrs) { - var $$modal = {}; - $$modal.index = attrs.index || ''; - $$modal.windowClass = attrs.windowClass || ''; - - //trigger CSS transitions - $timeout(function () { - $$modal.animate = true; - }); - } - }; - }]) - .factory('$modalStack', ['$document', '$compile', '$rootScope', '$$stackedMap', function ($document, $compile, $rootScope, $$stackedMap) { @@ -164,9 +147,8 @@ angular.module('ui.bootstrap.modal', []) keyboard: modal.keyboard }); - var angularDomEl = angular.element("
"); - angularDomEl.attr('window-class', modal.windowClass); - angularDomEl.attr('index', openedWindows.length() - 1); + var angularDomEl = angular.element("
"); + modal.scope.index = openedWindows.length() - 1; angularDomEl.html(modal.content); var modalDomEl = $compile(angularDomEl)(modal.scope); @@ -281,14 +263,17 @@ angular.module('ui.bootstrap.modal', []) ctrlInstance = $controller(modalOptions.controller, ctrlLocals); } + + if(modalOptions.windowClass) { + modalScope.windowClass = modalOptions.windowClass; + } $modalStack.open(modalInstance, { scope: modalScope, deferred: modalResultDeferred, content: tplAndVars[0], backdrop: modalOptions.backdrop, - keyboard: modalOptions.keyboard, - windowClass: modalOptions.windowClass + keyboard: modalOptions.keyboard }); }, function resolveError(reason) {