Commit 9a6d3bb3 authored by jun's avatar jun
Browse files

Merge branch 'MDL-74701-master' of https://github.com/HuongNV13/moodle

parents 81faa818 47c6c301
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -129,6 +129,7 @@ define(['jquery', 'core/str', 'core/custom_interaction_events'],
this.menuContainer.attr('aria-expanded', 'false');
this.menuContainer.attr('aria-hidden', 'true');
this.updateButtonAriaLabel();
this.updateFocusItemTabIndex();
this.root.trigger(this.events().menuClosed);
};
......@@ -149,6 +150,7 @@ define(['jquery', 'core/str', 'core/custom_interaction_events'],
this.menuContainer.attr('aria-expanded', 'true');
this.menuContainer.attr('aria-hidden', 'false');
this.updateButtonAriaLabel();
this.updateFocusItemTabIndex();
// Resolve the promises to allow the handlers to be added
// to the DOM, if they have been requested.
this.promises.closeHandlers.resolve();
......@@ -392,5 +394,18 @@ define(['jquery', 'core/str', 'core/custom_interaction_events'],
}.bind(this));
};
/**
* Set the appropriate tabindex attribute on the popover toggle.
*
* @method updateFocusItemTabIndex
*/
PopoverRegionController.prototype.updateFocusItemTabIndex = function() {
if (this.isMenuOpen()) {
this.menuContainer.find(SELECTORS.CAN_RECEIVE_FOCUS).removeAttr('tabindex');
} else {
this.menuContainer.find(SELECTORS.CAN_RECEIVE_FOCUS).attr('tabindex', '-1');
}
};
return PopoverRegionController;
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment