{"version":3,"file":"remuiloader.min.js","sources":["https:\/\/udl.id\/theme\/remui\/amd\/src\/remuiloader.js"],"sourcesContent":["\/* eslint-disable no-console *\/\n\/* eslint-disable jsdoc\/require-jsdoc*\/\n\/* eslint-disable jsdoc\/require-jsdoc*\/\n\/* eslint-disable jsdoc\/require-jsdoc*\/\n\/\/ This file is part of Moodle - http:\/\/moodle.org\/\n\/\/\n\/\/ Moodle is free software: you can redistribute it and\/or modify\n\/\/ it under the terms of the GNU General Public License as published by\n\/\/ the Free Software Foundation, either version 3 of the License, or\n\/\/ (at your option) any later version.\n\/\/\n\/\/ Moodle is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/ GNU General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU General Public License\n\/\/ along with Moodle. If not, see .\n\n\/**\n * @module theme_remui\/remuiloader\n * @copyright (c) 2020 WisdmLabs (https:\/\/wisdmlabs.com\/)\n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\ndefine(['jquery'], function ($) {\n\n const registerCommonEvents = () => {\n\n \/\/ Make AddBlock modal full Width.\n $('[data-key=\"addblock\"]').click(function () {\n setTimeout(function () {\n $('.modal[data-region=\"modal-container\"]').addClass(\"fullwidth-modal\");\n }, 500);\n });\n\n\n \/\/ This events handle the collapse issue on the messaging panel.\n msgBodyViewFavourite.on('click', function (e) {\n stopCollapseInMsgPanel(msgBodyViewFavourite, e);\n });\n\n msgBodyViewGroupmsg.on('click', function (e) {\n stopCollapseInMsgPanel(msgBodyViewGroupmsg, e);\n });\n\n msgBodyViewPrivate.on('click', function (e) {\n stopCollapseInMsgPanel(msgBodyViewPrivate, e);\n });\n\n \/\/ This events handle the collapse issue on the messaging page .\n msgPanelBodyViewFavourite.on('click', function (e) {\n stopCollapseInMsgPanel(msgPanelBodyViewFavourite, e);\n });\n\n msgPanelBodyViewGroupmsg.on('click', function (e) {\n stopCollapseInMsgPanel(msgPanelBodyViewGroupmsg, e);\n });\n\n msgPanelBodyViewPrivate.on('click', function (e) {\n stopCollapseInMsgPanel(msgPanelBodyViewPrivate, e);\n });\n\n $(\".nav-grouping-selector ul li \").on(\"click\", function () {\n $(this).siblings(\"li\").find(\"a\").removeAttr(\"aria-current\", false);\n $(this).find(\"a\").attr(\"aria-current\", true);\n });\n\n $(\".nav-display-selector ul li \").on(\"click\", function () {\n $(this).siblings(\"li\").find(\"a\").removeAttr(\"aria-current\", false);\n $(this).siblings(\"li\").find(\"span\").removeAttr(\"aria-current\", false);\n $(this).find(\"a\").attr(\"aria-current\", true);\n $(this).find(\"span\").attr(\"aria-current\", true);\n });\n\n registerGoToTopEvents();\n\n registerShowPasswordAction();\n };\n\n \/\/ Variables for msg body container\n var msgBodyViewFavourite = $('[data-region=\"body-container\"]').find('[data-region=\"view-overview-favourites\"]');\n var msgBodyViewGroupmsg = $('[data-region=\"body-container\"]').find('[data-region=\"view-overview-group-messages\"]');\n var msgBodyViewPrivate = $('[data-region=\"body-container\"]').find('[data-region=\"view-overview-messages\"]');\n\n \/\/ Variables for msg panel body container(messaging page)\n var msgPanelBodyViewFavourite = $('[data-region=\"panel-body-container\"]').find('[data-region=\"view-overview-favourites\"]');\n var msgPanelBodyViewGroupmsg = $('[data-region=\"panel-body-container\"]').find('[data-region=\"view-overview-group-messages\"]');\n var msgPanelBodyViewPrivate = $('[data-region=\"panel-body-container\"]').find('[data-region=\"view-overview-messages\"]');\n\n \/*\n * Common method to stop collapsing messaging tabs\n *\/\n const stopCollapseInMsgPanel = ($this, e) => {\n if ($this.hasClass('expanded')) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n \/*\n * Creating mini version of bootstrap-select for Dropdowns\n * {String} dropdownselector class selector for dropdown\n *\/\n const generateDropdownSearch = (dropdownselector) => {\n\n var _catmenus = $(dropdownselector + '+ .dropdown-menu');\n var _searchfield = \".catsearch\";\n\n var sr_text = M.util.get_string('searchcatplaceholdertext', 'theme_remui');\n var _inputfield = '
';\n _inputfield += '
';\n _inputfield += '