diff --git a/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-debug.js b/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-debug.js index 4a01a2566b4ec..1b5d4b821ceb7 100644 --- a/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-debug.js +++ b/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-debug.js @@ -260,6 +260,14 @@ CALENDAR.prototype = { this.toggle_calendar_image(); } }, this); + + // Get the calendarimage element by its ID and check if any of its parents have the modal-dialog class to + // know if the link is inside a modal, if so, set the aria-hidden and tabindex properties to the indicated values. + var calendarimageelement = document.getElementById(this.calendarimage.get('id')); + if (calendarimageelement.closest('.modal-dialog')) { + this.calendarimage.set('aria-hidden', true); + this.calendarimage.set('tabIndex', '-1'); + } }, focus_event: function(e) { M.form.dateselector.cancel_any_timeout(); @@ -363,11 +371,9 @@ CALENDAR.prototype = { // If the enable checkbox is not checked, disable the calendar image and prevent focus. if (!this.enablecheckbox.get('checked')) { this.calendarimage.addClass('disabled'); - this.calendarimage.setAttribute('tabindex', -1); this.release_calendar(); } else { this.calendarimage.removeClass('disabled'); - this.calendarimage.setAttribute('tabindex', 0); } } }; diff --git a/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-min.js b/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-min.js index f0ba47275ff05..9d10b424e208d 100644 --- a/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-min.js +++ b/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-form-dateselector",function(n,e){var t,o;n.mix(n.Node.prototype,{firstOptionValue:function(){return"select"===this.get("nodeName").toLowerCase()&&this.one("option").get("value")},lastOptionValue:function(){return"select"===this.get("nodeName").toLowerCase()&&this.all("option").item(this.optionSize()-1).get("value")},optionSize:function(){return"select"===this.get("nodeName").toLowerCase()&&parseInt(this.all("option").size(),10)},selectedOptionValue:function(){return"select"===this.get("nodeName").toLowerCase()&&this.all("option").item(this.get("selectedIndex")).get("value")}}),M.form=M.form||{},M.form.dateselector={panel:null,calendar:null,currentowner:null,hidetimeout:null,repositiontimeout:null,init_date_selectors:function(e){null===this.panel&&this.initPanel(e),n.all(".fdate_time_selector").each(function(){e.node=this,new t(e)}),n.all(".fdate_selector").each(function(){e.node=this,new t(e)})},initPanel:function(e){this.panel=new n.Overlay({visible:!1,bodyContent:n.Node.create('
'),id:"dateselector-calendar-panel",constrain:!0}),this.panel.render(document.body),this.panel.on("focus",function(){var e,t=0;n.all(" [role=dialog], [role=menubar], .moodle-has-zindex").each(function(e){e=this.findZIndex(e);t