mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
Merge branch 'MDL-74701-master' of https://github.com/HuongNV13/moodle
This commit is contained in:
commit
9a6d3bb3ba
3 changed files with 17 additions and 2 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -129,6 +129,7 @@ define(['jquery', 'core/str', 'core/custom_interaction_events'],
|
||||||
this.menuContainer.attr('aria-expanded', 'false');
|
this.menuContainer.attr('aria-expanded', 'false');
|
||||||
this.menuContainer.attr('aria-hidden', 'true');
|
this.menuContainer.attr('aria-hidden', 'true');
|
||||||
this.updateButtonAriaLabel();
|
this.updateButtonAriaLabel();
|
||||||
|
this.updateFocusItemTabIndex();
|
||||||
this.root.trigger(this.events().menuClosed);
|
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-expanded', 'true');
|
||||||
this.menuContainer.attr('aria-hidden', 'false');
|
this.menuContainer.attr('aria-hidden', 'false');
|
||||||
this.updateButtonAriaLabel();
|
this.updateButtonAriaLabel();
|
||||||
|
this.updateFocusItemTabIndex();
|
||||||
// Resolve the promises to allow the handlers to be added
|
// Resolve the promises to allow the handlers to be added
|
||||||
// to the DOM, if they have been requested.
|
// to the DOM, if they have been requested.
|
||||||
this.promises.closeHandlers.resolve();
|
this.promises.closeHandlers.resolve();
|
||||||
|
@ -392,5 +394,18 @@ define(['jquery', 'core/str', 'core/custom_interaction_events'],
|
||||||
}.bind(this));
|
}.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;
|
return PopoverRegionController;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue