MDL-79063 course: Use .text-body for 'disabled' elements in move modal

Using the .disabled class for the course module or section that is
being moved does not have sufficient colour contrast against the
background, especially when it is being highlighted.
So instead of using .disabled, just use Bootstrap classes .text-body
and .font-italic which renders the cm/section to be moved in normal
font colour while preserving its italicised look.
This commit is contained in:
Jun Pataleta 2023-08-18 16:28:45 +08:00
parent 23d6705ad6
commit 8fe9f8579d
No known key found for this signature in database
GPG Key ID: F83510526D99E2C7
3 changed files with 6 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -77,7 +77,8 @@ export default class extends BaseComponent {
};
// Component css classes.
this.classes = {
DISABLED: `disabled`,
DISABLED: `text-body`,
ITALIC: `font-italic`,
};
}
@ -427,6 +428,7 @@ export default class extends BaseComponent {
const targets = this.getElements(this.selectors.ADDSECTION);
targets.forEach(element => {
element.classList.toggle(this.classes.DISABLED, locked);
element.classList.toggle(this.classes.ITALIC, locked);
this.setElementLocked(element, locked);
});
}
@ -441,6 +443,7 @@ export default class extends BaseComponent {
element.style.pointerEvents = 'none';
element.style.userSelect = 'none';
element.classList.add(this.classes.DISABLED);
element.classList.add(this.classes.ITALIC);
element.setAttribute('aria-disabled', true);
element.addEventListener('click', event => event.preventDefault());
}