1 |
efrain |
1 |
define("core/showmore",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0;
|
|
|
2 |
/**
|
|
|
3 |
* Initializes and handles events fow 'showmore' components.
|
|
|
4 |
*
|
|
|
5 |
* @module core/showmore
|
|
|
6 |
* @copyright 2023 Mikel Martín <mikel@moodle.com>
|
|
|
7 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
8 |
*/
|
|
|
9 |
const Selectors_actions={toggleContent:'[data-action="toggle-content"]'},Selectors_regions={main:'[data-region="showmore"]'};let initialized=!1;_exports.init=()=>{initialized||(document.addEventListener("click",(event=>{const toggleContent=event.target.closest(Selectors_actions.toggleContent);if(toggleContent){const region=toggleContent.closest(Selectors_regions.main);region.classList.toggle("collapsed");region.querySelector(Selectors_actions.toggleContent).setAttribute("aria-expanded",!region.classList.contains("collapsed"))}})),initialized=!0)}}));
|
|
|
10 |
|
|
|
11 |
//# sourceMappingURL=showmore.min.js.map
|