- md5
- 8414fc83fb8658cbc1a050b8f68374d1
- sha1
- 5b1f8949dbfcf7dcef9e2c012aa2c956c005e6d1
- sha256
- 40243a00aad360c84f978e6d293328666300b76d25c5641c3702f3a02c2b305b
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla = window.Joomla || {};
(function (document) {
'use strict';
document.addEventListener('DOMContentLoaded', function () {
window.jSelectModuleType = function () {
var elements = document.querySelectorAll('#moduleDashboardAddModal .modal-footer .btn.hidden');
if (elements.length) {
setTimeout(function () {
elements.forEach(function (button) {
button.classList.remove('hidden');
});
}, 1000);
}
};
var buttons = document.querySelectorAll('#moduleDashboardAddModal .modal-footer .btn');
var hideButtons = [];
var isSaving = false;
if (buttons.length) {
buttons.forEach(function (button) {
if (button.classList.contains('hidden')) {
hideButtons.push(button);
}
button.addEventListener('click', function (event) {
var elem = event.currentTarget; // There is some bug with events in iframe where currentTarget is "null"
// => prevent this here by bubble up
if (!elem) {
elem = event.target;
}
if (elem) {
var clickTarget = elem.getAttribute('data-target'); // We remember to be in the saving process
isSaving = clickTarget === '#saveBtn'; // Reset saving process, if e.g. the validation of the form fails
setTimeout(function () {
isSaving = false;
}, 1500);
var iframe = document.querySelector('#moduleDashboardAddModal iframe');
var content = iframe.contentDocument || iframe.contentWindow.document;
var targetBtn = content.querySelector(clickTarget);
if (targetBtn) {
targetBtn.click();
}
}
});
});
} // @TODO remove jQuery dependency, when the modal is not bootstrap anymore
/* global jQuery */
jQuery('#moduleDashboardAddModal').on('hide.bs.modal', function () {
hideButtons.forEach(function (button) {
button.classList.add('hidden');
});
});
jQuery('#moduleDashboardAddModal').on('hidden.bs.modal', function () {
if (isSaving) {
setTimeout(function () {
window.parent.location.reload();
}, 1000);
}
});
});
})(document);
No other release has this exact content. See every version of this file.