mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Merge branch 'MDL-79337_master' of https://github.com/t-schroeder/moodle
This commit is contained in:
commit
884efcabd2
2
theme/boost/amd/build/drawers.min.js
vendored
2
theme/boost/amd/build/drawers.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -284,10 +284,10 @@ export default class Drawers {
|
||||
}
|
||||
|
||||
if (this.drawerNode.classList.contains(CLASSES.SHOW)) {
|
||||
this.openDrawer({focusOnCloseButton: false});
|
||||
this.openDrawer({focusOnCloseButton: false, setUserPref: false});
|
||||
} else if (this.drawerNode.dataset.forceopen == 1) {
|
||||
if (!isSmall()) {
|
||||
this.openDrawer({focusOnCloseButton: false});
|
||||
this.openDrawer({focusOnCloseButton: false, setUserPref: false});
|
||||
}
|
||||
} else {
|
||||
Aria.hide(this.drawerNode);
|
||||
@ -414,8 +414,9 @@ export default class Drawers {
|
||||
*
|
||||
* @param {object} args
|
||||
* @param {boolean} [args.focusOnCloseButton=true] Whether to alter page focus when opening the drawer
|
||||
* @param {boolean} [args.setUserPref=true] Whether to store the opened drawer state as a user preference
|
||||
*/
|
||||
openDrawer({focusOnCloseButton = true} = {}) {
|
||||
openDrawer({focusOnCloseButton = true, setUserPref = true} = {}) {
|
||||
|
||||
const pendingPromise = new Pending('theme_boost/drawers:open');
|
||||
const showEvent = this.dispatchEvent(Drawers.eventTypes.drawerShow, true);
|
||||
@ -439,7 +440,7 @@ export default class Drawers {
|
||||
this.drawerNode.classList.add(CLASSES.SHOW);
|
||||
|
||||
const preference = this.drawerNode.dataset.preference;
|
||||
if (preference && !isSmall() && (this.drawerNode.dataset.forceopen != 1)) {
|
||||
if (preference && !isSmall() && (this.drawerNode.dataset.forceopen != 1) && setUserPref) {
|
||||
setUserPreference(preference, true);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user