mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-80197' of https://github.com/pedrojordao/moodle
This commit is contained in:
commit
a42d1335f5
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
10
lib/form/yui/src/dateselector/js/calendar.js
vendored
10
lib/form/yui/src/dateselector/js/calendar.js
vendored
@ -52,6 +52,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();
|
||||
@ -155,11 +163,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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user