a11y issues on upgrade footer.

LEARNER-3055
This commit is contained in:
Harry Rein
2018-01-22 09:38:54 -05:00
parent c368c9066d
commit 9dab9d2c20
3 changed files with 19 additions and 16 deletions

View File

@@ -52,9 +52,13 @@ export class CourseSock { // eslint-disable-line import/prefer-default-export
// Open the sock when user clicks to Learn More
$toggleActionButton.on('click', () => {
const toggleSpeed = 400;
$toggleActionButton.toggleClass('active').toggleClass('aria-expanded');
$toggleActionButton.toggleClass('active');
$verificationSock.slideToggle(toggleSpeed, fixUpgradeButton);
// Toggle aria-expanded attribute
const newAriaExpandedState = $toggleActionButton.attr('aria-expanded') === 'false';
$toggleActionButton.attr('aria-expanded', newAriaExpandedState);
// Log open and close events
const isOpening = $toggleActionButton.hasClass('active');
const logMessage = isOpening ? 'edx.bi.course.sock.toggle_opened'