Skip to content
Snippets Groups Projects
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
Branches S13788_datetimepicker_selectable_weekdays
No related tags found
3 merge requests!430Merge new version 22.05,!423F9052: New feature implemented with js to edit content records in front end....,!421F9052: New feature implemented with js to edit content records in front end....
Pipeline #6930 passed
......@@ -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;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment