Current Path : C:/xampp/htdocs/moodle/mod/assign/amd/build/ |
Current File : C:/xampp/htdocs/moodle/mod/assign/amd/build/override_form.min.js.map |
{"version":3,"sources":["../src/override_form.js"],"names":["init","formId","selectElementName","form","document","getElementById","selectElement","querySelector","on","inputElement","createElement","setAttribute","appendChild","M","core_formchangechecker","reset_form_dirty_state","submit"],"mappings":"kJAsBA,uDAEO,GAAMA,CAAAA,CAAI,CAAG,SAACC,CAAD,CAASC,CAAT,CAA+B,IACzCC,CAAAA,CAAI,CAAGC,QAAQ,CAACC,cAAT,CAAwBJ,CAAxB,CADkC,CAEzCK,CAAa,CAAGH,CAAI,CAACI,aAAL,mBAA6BL,CAA7B,QAFyB,CAI/C,cAAEI,CAAF,EAAiBE,EAAjB,CAAoB,QAApB,CAA8B,UAAM,CAChC,GAAMC,CAAAA,CAAY,CAAGL,QAAQ,CAACM,aAAT,CAAuB,OAAvB,CAArB,CACAD,CAAY,CAACE,YAAb,CAA0B,MAA1B,CAAkC,QAAlC,EACAF,CAAY,CAACE,YAAb,CAA0B,MAA1B,CAAkC,YAAlC,EACAF,CAAY,CAACE,YAAb,CAA0B,OAA1B,KAEAR,CAAI,CAACS,WAAL,CAAiBH,CAAjB,EAEA,GAAwC,WAApC,QAAOI,CAAAA,CAAC,CAACC,sBAAb,CAAqD,CACjDD,CAAC,CAACC,sBAAF,CAAyBC,sBAAzB,EACH,CAEDZ,CAAI,CAACa,MAAL,EACH,CAbD,CAcH,CAlBM,C","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 * A javascript module to enhance the override form.\n *\n * @copyright 2019 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\n\nexport const init = (formId, selectElementName) => {\n const form = document.getElementById(formId);\n const selectElement = form.querySelector(`[name=\"${selectElementName}\"]`);\n\n $(selectElement).on('change', () => {\n const inputElement = document.createElement('input');\n inputElement.setAttribute('type', 'hidden');\n inputElement.setAttribute('name', 'userchange');\n inputElement.setAttribute('value', true);\n\n form.appendChild(inputElement);\n\n if (typeof M.core_formchangechecker !== 'undefined') {\n M.core_formchangechecker.reset_form_dirty_state();\n }\n\n form.submit();\n });\n};"],"file":"override_form.min.js"}