Commit b2402f14 authored by enured's avatar enured
Browse files

F9052: Fix -> Now editing in extern window works parallel while a form is open in main page.

parent ce0045c5
Pipeline #6930 passed with stage
in 1 minute and 51 seconds
......@@ -107,6 +107,7 @@ $(document).ready(function(){
// Show same content editor with refreshed data again after save. Control it with the given get parameter. First fetch only needed html content again (form) and open it in same window.
var urlParams = new URLSearchParams(window.location.search);
var ttContentParam = urlParams.get('tt-content');
var pageId = urlParams.get('id');
if(ttContentParam !== null && $(targetEditReportButton).next("#"+ttContentParam)[0] !== undefined){
var formContent = $($(targetEditReportButton).next("#"+ttContentParam)[0].outerHTML);
......@@ -117,8 +118,13 @@ $(document).ready(function(){
$(externWindow).submit(function() {
$.post($(externWindow).attr('action'),$(externWindow).serializeArray());
alert("Changes have been saved. Reload your primary window after that.");
if(pageId === null){
pageId = '';
}else{
pageId = 'id='+pageId+'&';
}
if(window.location.search !== '?'+"tt-content="+$('form').attr('id')){
window.location.href += "?"+"tt-content="+$('form').attr('id');
window.location.href = '//' + location.host + location.pathname + "?" +pageId+ "tt-content=" + $('form').attr('id');
}
return false;
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment