{"version":3,"file":"navblock.min.js","sources":["https:\/\/lms.ubu.ac.th\/ubulms\/blocks\/navigation\/amd\/src\/navblock.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 * Load the navigation tree javascript.\n *\n * @module block_navigation\/navblock\n * @copyright 2015 John Okely \n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\nimport {notifyBlockContentUpdated} from 'core_block\/events';\nimport Tree from 'core\/tree';\n\n\/**\n * Initialise the navblock javascript for the specified block instance.\n *\n * @method\n * @param {Number} instanceId\n *\/\nexport const init = instanceId => {\n const navTree = new Tree(\".block_navigation .block_tree\");\n const blockNode = document.querySelector(`[data-instance-id=\"${instanceId}\"]`);\n\n \/**\n * The method to call when then the navtree finishes expanding a group.\n *\n * @method finishExpandingGroup\n * @param {Object} item\n * @fires event:blockContentUpdated\n *\/\n navTree.finishExpandingGroup = item => {\n Tree.prototype.finishExpandingGroup.call(navTree, item);\n notifyBlockContentUpdated(blockNode);\n };\n\n \/**\n * The method to call whe then the navtree collapses a group\n *\n * @method collapseGroup\n * @param {Object} item\n * @fires event:blockContentUpdated\n *\/\n navTree.collapseGroup = item => {\n Tree.prototype.collapseGroup.call(navTree, item);\n notifyBlockContentUpdated(blockNode);\n };\n};\n"],"names":["instanceId","navTree","Tree","blockNode","document","querySelector","finishExpandingGroup","item","prototype","call","collapseGroup"],"mappings":";;;;;;;oJA+BoBA,mBACVC,QAAU,IAAIC,cAAK,iCACnBC,UAAYC,SAASC,2CAAoCL,kBAS\/DC,QAAQK,qBAAuBC,qBACtBC,UAAUF,qBAAqBG,KAAKR,QAASM,4CACxBJ,YAU9BF,QAAQS,cAAgBH,qBACfC,UAAUE,cAAcD,KAAKR,QAASM,4CACjBJ"}