mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
Merge branch 'MDL-80195' of https://github.com/pedrojordao/moodle
This commit is contained in:
commit
e8aee4a120
@ -316,6 +316,17 @@ CALENDAR.prototype = {
|
||||
|
||||
// When the user tab out the calendar, close it.
|
||||
Y.one(document.body).on('keyup', function(e) {
|
||||
// If the calendar is open and we try to access it by pressing tab, we check if it is inside a Bootstrap dropdown-menu,
|
||||
// if so, we keep the dropdown open while navigation takes place in the calendar.
|
||||
if (M.form.dateselector.currentowner && e.keyCode === 9) {
|
||||
e.stopPropagation();
|
||||
var calendarimageelement = document.getElementById(M.form.dateselector.currentowner.calendarimage.get('id'));
|
||||
if (M.form.dateselector.calendar.get('focused') && calendarimageelement.closest('.dropdown-menu') &&
|
||||
!calendarimageelement.closest('.dropdown-menu').classList.contains("show")) {
|
||||
calendarimageelement.closest('.dropdown-menu').classList.add('show');
|
||||
}
|
||||
}
|
||||
|
||||
// hide the calendar if we press a key and the calendar is not focussed, or if we press ESC in the calendar.
|
||||
if ((M.form.dateselector.currentowner === this && !M.form.dateselector.calendar.get('focused')) ||
|
||||
((e.keyCode === 27) && M.form.dateselector.calendar.get('focused'))) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -316,6 +316,17 @@ CALENDAR.prototype = {
|
||||
|
||||
// When the user tab out the calendar, close it.
|
||||
Y.one(document.body).on('keyup', function(e) {
|
||||
// If the calendar is open and we try to access it by pressing tab, we check if it is inside a Bootstrap dropdown-menu,
|
||||
// if so, we keep the dropdown open while navigation takes place in the calendar.
|
||||
if (M.form.dateselector.currentowner && e.keyCode === 9) {
|
||||
e.stopPropagation();
|
||||
var calendarimageelement = document.getElementById(M.form.dateselector.currentowner.calendarimage.get('id'));
|
||||
if (M.form.dateselector.calendar.get('focused') && calendarimageelement.closest('.dropdown-menu') &&
|
||||
!calendarimageelement.closest('.dropdown-menu').classList.contains("show")) {
|
||||
calendarimageelement.closest('.dropdown-menu').classList.add('show');
|
||||
}
|
||||
}
|
||||
|
||||
// hide the calendar if we press a key and the calendar is not focussed, or if we press ESC in the calendar.
|
||||
if ((M.form.dateselector.currentowner === this && !M.form.dateselector.calendar.get('focused')) ||
|
||||
((e.keyCode === 27) && M.form.dateselector.calendar.get('focused'))) {
|
||||
|
11
lib/form/yui/src/dateselector/js/calendar.js
vendored
11
lib/form/yui/src/dateselector/js/calendar.js
vendored
@ -108,6 +108,17 @@ CALENDAR.prototype = {
|
||||
|
||||
// When the user tab out the calendar, close it.
|
||||
Y.one(document.body).on('keyup', function(e) {
|
||||
// If the calendar is open and we try to access it by pressing tab, we check if it is inside a Bootstrap dropdown-menu,
|
||||
// if so, we keep the dropdown open while navigation takes place in the calendar.
|
||||
if (M.form.dateselector.currentowner && e.keyCode === 9) {
|
||||
e.stopPropagation();
|
||||
var calendarimageelement = document.getElementById(M.form.dateselector.currentowner.calendarimage.get('id'));
|
||||
if (M.form.dateselector.calendar.get('focused') && calendarimageelement.closest('.dropdown-menu') &&
|
||||
!calendarimageelement.closest('.dropdown-menu').classList.contains("show")) {
|
||||
calendarimageelement.closest('.dropdown-menu').classList.add('show');
|
||||
}
|
||||
}
|
||||
|
||||
// hide the calendar if we press a key and the calendar is not focussed, or if we press ESC in the calendar.
|
||||
if ((M.form.dateselector.currentowner === this && !M.form.dateselector.calendar.get('focused')) ||
|
||||
((e.keyCode === 27) && M.form.dateselector.calendar.get('focused'))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user