11 lines
972 B
JavaScript
11 lines
972 B
JavaScript
define("core/showmore",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0;
|
|
/**
|
|
* Initializes and handles events fow 'showmore' components.
|
|
*
|
|
* @module core/showmore
|
|
* @copyright 2023 Mikel Martín <mikel@moodle.com>
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
*/
|
|
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)}}));
|
|
|
|
//# sourceMappingURL=showmore.min.js.map
|