Commit 926edef5 authored by totof's avatar totof

#65 : Ajout dynamique de l'attribut aria-hidden sur la modale

parent 209a8730
......@@ -90,7 +90,9 @@
that.$element[0].offsetWidth // force reflow
}
that.$element.addClass('in')
that.$element
.addClass('in')
.attr('aria-hidden', false)
that.enforceFocus()
......@@ -124,6 +126,7 @@
this.$element
.removeClass('in')
.attr('aria-hidden', true)
.off('click.dismiss.bs.modal')
.off('mouseup.dismiss.bs.modal')
......@@ -206,7 +209,9 @@
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
this.$backdrop
.addClass('in')
.attr('aria-hidden', false)
if (!callback) return
......@@ -217,7 +222,9 @@
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
this.$backdrop
.removeClass('in')
.attr('aria-hidden', true)
var callbackRemove = function () {
that.removeBackdrop()
......@@ -388,9 +395,9 @@
return (/input|select|textarea|button|object/.test(nodeName) ?
!element.disabled :
"a" === nodeName ?
element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element); // the element and all of its ancestors must be visible
element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element); // the element and all of its ancestors must be visible
}
var visible = function(element) {
return $.expr.filters.visible(element) &&
!$(element).parents().addBack().filter(function() {
......@@ -447,10 +454,10 @@
modalHide.apply(this, arguments);
$(document).off('keydown.bs.modal');
};
$.fn.modal.Constructor.prototype.show = function () {
modalShow.apply(this, arguments);
var $tabbablesAndFocusables = this.$element.find(':tabbable').filter(':focusable');
var $tabbablesAndFocusables = this.$element.find(':tabbable').filter(':focusable');
if($tabbablesAndFocusables.length > 0) {
$tabbablesAndFocusables[0].focus();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment