2020-01-31 11:25:26 +01:00
|
|
|
this.Element && function(ElementPrototype) {
|
|
|
|
ElementPrototype.closest = ElementPrototype.closest ||
|
|
|
|
function(selector) {
|
|
|
|
var el = this;
|
|
|
|
while (el.matches && !el.matches(selector)) el = el.parentNode;
|
|
|
|
return el.matches ? el : null;
|
|
|
|
}
|
|
|
|
}(Element.prototype);
|
|
|
|
|
2019-01-20 12:55:15 +01:00
|
|
|
function editModuleOnClickHandler(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
var element = event.target;
|
2020-01-31 11:25:26 +01:00
|
|
|
|
|
|
|
if (element.tagName !== 'A') {
|
|
|
|
element = element.closest('A.typo3-adminPanel-btn-openBackend');
|
2019-01-20 12:55:15 +01:00
|
|
|
}
|
2020-01-31 11:25:26 +01:00
|
|
|
|
|
|
|
var vHWin = window.open(element.getAttribute('data-backendScript'), element.getAttribute('data-t3BeSitenameMd5'));
|
|
|
|
vHWin.focus();
|
2019-01-20 12:55:15 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function initializeEditModule() {
|
2020-01-31 11:25:26 +01:00
|
|
|
var editModuleBtnsOpenBackend = document.querySelectorAll('.typo3-adminPanel-btn-openBackend');
|
|
|
|
for (var i = 0, len = editModuleBtnsOpenBackend.length; i < len; i++ ) {
|
|
|
|
editModuleBtnsOpenBackend[i].addEventListener('click', editModuleOnClickHandler);
|
|
|
|
}
|
2019-01-20 12:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener('load', initializeEditModule, false);
|