Skip to content

Commit 67c9674

Browse files
committed
Merge branch 'master' of github.com:mgcrea/angular-strap
2 parents f314456 + d77f523 commit 67c9674

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/directives/modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ angular.module('$strap.directives')
9090
};
9191

9292
$q.when($modal(options)).then(function onSuccess(modal) {
93-
iElement.attr('href', '#' + modal.attr('id')).attr('data-toggle', 'modal');
93+
iElement.attr('data-target', '#' + modal.attr('id')).attr('data-toggle', 'modal');
9494
});
9595

9696
}

test/unit/directives/modalSpec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ describe('modal', function () {
4545
it('should fetch the partial and build the modal', function () {
4646
var elm = compileDirective();
4747
expect(elm.attr('data-toggle')).toBe('modal');
48-
expect(elm.attr('href')).toBeDefined();
49-
var $modal = $(elm.attr('href'));
48+
expect(elm.attr('data-target')).toBeDefined();
49+
var $modal = $(elm.attr('data-target'));
5050
expect($modal.hasClass('modal')).toBe(true);
5151
expect($modal.html()).toBe(scope.modal);
5252
});
5353

5454
it('should handle extra attributes', function () {
5555
var elm = compileDirective('extra');
56-
var $modal = $(elm.attr('href'));
56+
var $modal = $(elm.attr('data-target'));
5757
// expect($modal.attr('data-backdrop')).toBe('0');
5858
// expect($modal.attr('data-keyboard')).toBe('0');
5959
expect($modal.hasClass('modal-wide')).toBe(true);
@@ -63,8 +63,8 @@ describe('modal', function () {
6363
compileDirective('cached', true);
6464
expect(scope.$$asyncQueue.length).toBe(0);
6565
var elm = $('a[bs-modal]');
66-
expect(elm.attr('href')).toBeDefined();
67-
var $modal = $(elm.attr('href'));
66+
expect(elm.attr('data-target')).toBeDefined();
67+
var $modal = $(elm.attr('data-target'));
6868
expect($modal.hasClass('modal')).toBe(true);
6969
expect($modal.html()).toBe(scope.modal);
7070
});
@@ -79,14 +79,14 @@ describe('modal', function () {
7979

8080
it('should resolve scope variables in the external partial', function() {
8181
var elm = compileDirective();
82-
var $modal = $(elm.attr('href'));
82+
var $modal = $(elm.attr('data-target'));
8383
$modal.modal('show'); $timeout.flush();
8484
expect($modal.text()).toBe('Hello ' + scope.content.replace(/<br \/>/g, ''));
8585
});
8686

8787
it('should show the modal on click', function(/*done*/) {
8888
var elm = compileDirective();
89-
var $modal = $(elm.attr('href'));
89+
var $modal = $(elm.attr('data-target'));
9090
expect($modal.hasClass('hide')).toBe(true);
9191
elm.trigger('click');
9292
/*setTimeout(function() {
@@ -102,7 +102,7 @@ describe('modal', function () {
102102

103103
beforeEach(function() {
104104
elm = compileDirective();
105-
$modal = $(elm.attr('href'));
105+
$modal = $(elm.attr('data-target'));
106106
spy = jasmine.createSpy('event');
107107
});
108108

0 commit comments

Comments
 (0)