{"version":3,"file":"collapseblock.min.js","sources":["https:\/\/enfermeria.aulavirtual.unc.edu.ar\/theme\/adaptable\/amd\/src\/collapseblock.js"],"sourcesContent":["\/\/ 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\/\/ Collapse block.\n\/\/\n\/\/ @module theme_adaptable\/collapseblock\n\/\/ @copyright 2023 G J Barnard.\n\/\/ @author G J Barnard -\n\/\/ {@link https:\/\/moodle.org\/user\/profile.php?id=442195}\n\/\/ {@link https:\/\/gjbarnard.co.uk}\n\/\/ @license https:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later.\n\/\/\n\nimport $ from 'jquery';\nimport * as AdaptableUtil from 'theme_adaptable\/util';\nimport log from 'core\/log';\n\n\/**\n * Collapse Block class.\n *\/\nclass CollapseBlock {\n static noInit = true;\n\n static collapseBlock() {\n if (CollapseBlock.noInit) {\n CollapseBlock.noInit = false;\n $('.block-collapsible').click(function() {\n var instanceId = $(this).data('instanceid');\n var blockInstance = $('#inst' + instanceId);\n\n $('#inst' + instanceId + ' .content').slideToggle('slow', function() {\n if (blockInstance.hasClass('hidden')) {\n blockInstance.removeClass('hidden');\n AdaptableUtil.setUserPreference('block' + instanceId + 'hidden', 0);\n } else {\n blockInstance.addClass('hidden');\n AdaptableUtil.setUserPreference('block' + instanceId + 'hidden', 1);\n }\n });\n });\n log.debug('Adaptable Collapse Block ES6 collapseBlock');\n }\n }\n}\n\n\/**\n * Init.\n *\/\nexport const collapseBlockInit = () => {\n if (document.readyState !== 'loading') {\n CollapseBlock.collapseBlock();\n } else {\n document.addEventListener('DOMContentLoaded', function () {\n CollapseBlock.collapseBlock();\n });\n }\n};\n"],"names":["CollapseBlock","noInit","click","instanceId","this","data","blockInstance","slideToggle","hasClass","removeClass","AdaptableUtil","setUserPreference","addClass","debug","document","readyState","collapseBlock","addEventListener"],"mappings":"s0CAiCMA,qCAIMA,cAAcC,SACdD,cAAcC,QAAS,sBACrB,sBAAsBC,OAAM,eACtBC,YAAa,mBAAEC,MAAMC,KAAK,cAC1BC,eAAgB,mBAAE,QAAUH,gCAE9B,QAAUA,WAAa,aAAaI,YAAY,QAAQ,WAClDD,cAAcE,SAAS,WACvBF,cAAcG,YAAY,UAC1BC,cAAcC,kBAAkB,QAAUR,WAAa,SAAU,KAEjEG,cAAcM,SAAS,UACvBF,cAAcC,kBAAkB,QAAUR,WAAa,SAAU,uBAIzEU,MAAM,yEAnBF,uBADdb,gJA4B2B,KACD,YAAxBc,SAASC,WACTf,cAAcgB,gBAEdF,SAASG,iBAAiB,oBAAoB,WAC1CjB,cAAcgB"}