Skip to content

Commit

Permalink
add proper role to dialog markup and cleanup modal logging
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed May 17, 2012
1 parent 4b53778 commit 10c6db4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 33 deletions.
8 changes: 4 additions & 4 deletions docs/assets/css/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -4643,15 +4643,15 @@ a.badge:hover {
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: width 0.6s ease;
-moz-transition: width 0.6s ease;
-ms-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}

.progress-striped .bar {
Expand Down
10 changes: 2 additions & 8 deletions docs/assets/js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
$('body').removeClass('modal-open')

this.escape()
this.relaxFocus()

$(document).off('focusin.modal')

this.$element.removeClass('in')

Expand All @@ -106,20 +107,13 @@

, enforceFocus: function () {
var that = this
var console = window.console
console.log('attach');
$(document).on('focusin.modal', function (e) {
console.log('triggered');
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
that.$element.focus()
}
})
}

, relaxFocus: function () {
$(document).off('focus.modal')
}

, escape: function () {
var that = this
if (this.isShown && this.options.keyboard) {
Expand Down
10 changes: 2 additions & 8 deletions docs/assets/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,8 @@
$('body').removeClass('modal-open')

this.escape()
this.relaxFocus()

$(document).off('focusin.modal')

this.$element.removeClass('in')

Expand All @@ -773,20 +774,13 @@

, enforceFocus: function () {
var that = this
var console = window.console
console.log('attach');
$(document).on('focusin.modal', function (e) {
console.log('triggered');
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
that.$element.focus()
}
})
}

, relaxFocus: function () {
$(document).off('focus.modal')
}

, escape: function () {
var that = this
if (this.isShown && this.options.keyboard) {
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/bootstrap.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ <h2>Live demo</h2>
<p>Toggle a modal via javascript by clicking the button below. It will slide down and fade in from the top of the page.</p>

<!-- sample modal content -->
<div id="myModal" class="modal hide fade" tabindex=0>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModal-label">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3>Modal Heading</h3>
<h3 id="myModal-label">Modal Heading</h3>
</div>
<div class="modal-body">
<h4>Text in a modal</h4>
Expand Down
4 changes: 2 additions & 2 deletions docs/templates/pages/javascript.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@
<p>{{_i}}Toggle a modal via javascript by clicking the button below. It will slide down and fade in from the top of the page.{{/i}}</p>

<!-- sample modal content -->
<div id="myModal" class="modal hide fade" tabindex="0">
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModal-label">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3>{{_i}}Modal Heading{{/i}}</h3>
<h3 id="myModal-label">{{_i}}Modal Heading{{/i}}</h3>
</div>
<div class="modal-body">
<h4>{{_i}}Text in a modal{{/i}}</h4>
Expand Down
10 changes: 2 additions & 8 deletions js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
$('body').removeClass('modal-open')

this.escape()
this.relaxFocus()

$(document).off('focusin.modal')

this.$element.removeClass('in')

Expand All @@ -106,20 +107,13 @@

, enforceFocus: function () {
var that = this
var console = window.console
console.log('attach');
$(document).on('focusin.modal', function (e) {
console.log('triggered');
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
that.$element.focus()
}
})
}

, relaxFocus: function () {
$(document).off('focus.modal')
}

, escape: function () {
var that = this
if (this.isShown && this.options.keyboard) {
Expand Down

0 comments on commit 10c6db4

Please sign in to comment.