admin-modules-modal.min.js 1.07 KB
document.addEventListener('DOMContentLoaded',function(){'use strict';var b,a=document.querySelectorAll('.js-module-insert'),c=document.querySelectorAll('.js-position-insert');for(b=0;a.length>b;b++)a[b].addEventListener('click',function(d){d.preventDefault();var e=d.target.getAttribute('data-module'),f=d.target.getAttribute('data-editor');window.parent.Joomla&&window.parent.Joomla.editors&&window.parent.Joomla.editors.instances&&window.parent.Joomla.editors.instances.hasOwnProperty(f)?window.parent.Joomla.editors.instances[f].replaceSelection('{loadmoduleid '+e+'}'):window.parent.jInsertEditorText('{loadmoduleid '+e+'}',f),window.parent.jModalClose()});for(b=0;c.length>b;b++)c[b].addEventListener('click',function(d){d.preventDefault();var e=d.target.getAttribute('data-position'),f=d.target.getAttribute('data-editor');window.Joomla&&window.Joomla.editors&&Joomla.editors.instances&&Joomla.editors.instances.hasOwnProperty(f)?Joomla.editors.instances[f].replaceSelection('{loadposition '+e+'}'):window.parent.jInsertEditorText('{loadposition '+e+'}',f),window.parent.jModalClose()})});