1 |
efrain |
1 |
{"version":3,"file":"modal_helper.min.js","sources":["../src/modal_helper.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 <http://www.gnu.org/licenses/>.\n\n/**\n * unilabel modal helper\n *\n * @author Andreas Grabs <info@grabs-edv.de>\n * @copyright 2018 onwards Grabs EDV {@link https://www.grabs-edv.de}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n return {\n 'init': function(modalselector) {\n $(modalselector).on('show.bs.modal', function() {\n $(this).appendTo('body');\n });\n\n // Hack for stacked modals to show the backdrop with the right z-index.\n $(document).on('show.bs.modal', '.modal', function() {\n var zIndex = 1040 + (10 * $('.modal:visible').length);\n $(this).css('z-index', zIndex);\n setTimeout(function() {\n $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack');\n }, 100);\n });\n\n // Hack to enable stacked modals by making sure the .modal-open class\n // is set to the <body> when there is at least one modal open left.\n $(document).on('hidden.bs.modal', function() {\n if ($('.modal.show').length > 0) {\n $('body').addClass('modal-open');\n }\n });\n\n },\n 'show': function(modalselector) {\n $(modalselector).modal('show');\n }\n };\n});"],"names":["define","$","modalselector","on","this","appendTo","document","zIndex","length","css","setTimeout","not","addClass","modal"],"mappings":";;;;;;;AAuBAA,mCAAO,CAAC,WAAW,SAASC,SACjB,MACK,SAASC,eACbD,EAAEC,eAAeC,GAAG,iBAAiB,WACjCF,EAAEG,MAAMC,SAAS,WAIrBJ,EAAEK,UAAUH,GAAG,gBAAiB,UAAU,eAClCI,OAAS,KAAQ,GAAKN,EAAE,kBAAkBO,OAC9CP,EAAEG,MAAMK,IAAI,UAAWF,QACvBG,YAAW,WACPT,EAAE,mBAAmBU,IAAI,gBAAgBF,IAAI,UAAWF,OAAS,GAAGK,SAAS,iBAC9E,QAKPX,EAAEK,UAAUH,GAAG,mBAAmB,WAC1BF,EAAE,eAAeO,OAAS,GAC1BP,EAAE,QAAQW,SAAS,uBAKvB,SAASV,eACbD,EAAEC,eAAeW,MAAM"}
|