From 00829b60580a5b800772b83cfcc78d53d2551796 Mon Sep 17 00:00:00 2001 From: Tasos Bekos Date: Sun, 13 Apr 2014 23:42:05 +0300 Subject: [PATCH] refactor(modal): add class to element instead of template expression --- src/modal/modal.js | 2 +- src/modal/test/modalWindow.spec.js | 3 ++- template/modal/window.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index c86048ded3..f60eadb243 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -85,7 +85,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition']) transclude: true, templateUrl: 'template/modal/window.html', link: function (scope, element, attrs) { - scope.windowClass = attrs.windowClass || ''; + element.addClass(attrs.windowClass || ''); $timeout(function () { // trigger CSS transitions diff --git a/src/modal/test/modalWindow.spec.js b/src/modal/test/modalWindow.spec.js index c117ee9207..6c9ce8d29b 100644 --- a/src/modal/test/modalWindow.spec.js +++ b/src/modal/test/modalWindow.spec.js @@ -10,9 +10,10 @@ describe('modal window', function () { })); it('should support custom CSS classes as string', function () { - var windowEl = $compile('
content
')($rootScope); + var windowEl = $compile('
content
')($rootScope); $rootScope.$digest(); expect(windowEl).toHaveClass('test'); + expect(windowEl).toHaveClass('foo'); }); }); \ No newline at end of file diff --git a/template/modal/window.html b/template/modal/window.html index 5c3b1aa27b..419c4b764c 100644 --- a/template/modal/window.html +++ b/template/modal/window.html @@ -1,3 +1,3 @@ -