Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(dialog): prefix dialog content probably
Browse files Browse the repository at this point in the history
At the moment, the dialog always retrieved an id of `dialogContent_undefined`

Fixes #7469. Closes #7480
  • Loading branch information
devversion authored and ThomasBurleson committed Mar 9, 2016
1 parent 4a2c362 commit 32951a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ function MdDialogProvider($$interimElementProvider) {

var role = (options.$type === 'alert') ? 'alertdialog' : 'dialog';
var dialogContent = element.find('md-dialog-content');
var dialogContentId = ('dialogContent_' + element.attr('id')) || ('dialogContent_' + $mdUtil.nextUid());
var dialogContentId = 'dialogContent_' + (element.attr('id') || $mdUtil.nextUid());

element.attr({
'role': role,
Expand Down
4 changes: 2 additions & 2 deletions src/components/dialog/dialog.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ describe('$mdDialog', function() {

var dialog = parent.find('md-dialog');
var content = parent[0].querySelector('md-dialog-content');

expect(content.id).toMatch(/dialogContent_.*/g);
expect(content.id).toMatch(/dialogContent_[0-9]+/g);
}));

it('should remove `md-dialog-container` on mousedown mouseup and remove', inject(function($mdDialog, $rootScope, $timeout) {
Expand Down

0 comments on commit 32951a7

Please sign in to comment.