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 294ea131a7
commit 13a8dff553
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
@@ -83,7 +83,8 @@ export default class extends BaseComponent {
};
// Component css classes.
this.classes = {
DISABLED: `disabled`,
DISABLED: `text-body`,
ITALIC: `font-italic`,
};
}
@@ -673,6 +674,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);
});
}
@@ -687,6 +689,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());
}