Skip to content

Commit

Permalink
[GH-214] add data-dismiss and aria-hidden attributes to close button
Browse files Browse the repository at this point in the history
  • Loading branch information
makeusabrew committed Feb 1, 2014
1 parent fc84191 commit 4d84380
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bootbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
footer:
"<div class='modal-footer'></div>",
closeButton:
"<button type='button' class='bootbox-close-button close'>&times;</button>",
"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>",
form:
"<form class='bootbox-form'></form>",
inputs: {
Expand Down
8 changes: 8 additions & 0 deletions tests/alert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ describe("bootbox.alert", function() {
expect(this.find(".modal-body button").hasClass("close")).to.be.true;
});

it("applies the correct data-dismiss attribute to the close button", function() {
expect(this.find("button.close").attr("data-dismiss")).to.equal("modal");
});

it("applies the correct aria-hidden attribute to the close button", function() {
expect(this.find("button.close").attr("aria-hidden")).to.equal("true");
});

});
});

Expand Down

0 comments on commit 4d84380

Please sign in to comment.