diff --git a/api/js/etemplate/etemplate2.js b/api/js/etemplate/etemplate2.js index 16b783e50f..ea3ba8bb7b 100644 --- a/api/js/etemplate/etemplate2.js +++ b/api/js/etemplate/etemplate2.js @@ -365,7 +365,7 @@ var etemplate2 = /** @class */ (function () { var appname = _name.split('.')[0]; // if no app object provided and template app is not currentapp (eg. infolog CRM view) // create private app object / closure with just classes / prototypes - if (!_app && appname && appname != currentapp || _open_target == "_tab") { + if (!_app && appname && appname != currentapp || _open_target) { app = { classes: window.app.classes }; } // remember used app object, to eg. use: onchange="widget.getInstanceMgr().app_object[app].callback()" @@ -995,6 +995,8 @@ var etemplate2 = /** @class */ (function () { } // handle framework.setSidebox calls if (window.framework && jQuery.isArray(data.setSidebox)) { + if (data['open-target']) + data.setSidebox[0] = data['open-target']; window.framework.setSidebox.apply(window.framework, data.setSidebox); } // regular et2 re-load diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index 4a43208d4a..900c90c337 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -462,7 +462,7 @@ export class etemplate2 const appname = _name.split('.')[0]; // if no app object provided and template app is not currentapp (eg. infolog CRM view) // create private app object / closure with just classes / prototypes - if (!_app && appname && appname != currentapp || _open_target == "_tab") + if (!_app && appname && appname != currentapp || _open_target) { app = {classes: window.app.classes}; } @@ -1280,6 +1280,8 @@ export class etemplate2 // handle framework.setSidebox calls if (window.framework && jQuery.isArray(data.setSidebox)) { + if (data['open-target']) data.setSidebox[0] = data['open-target']; + window.framework.setSidebox.apply(window.framework, data.setSidebox); } diff --git a/api/js/framework/fw_base.js b/api/js/framework/fw_base.js index b516ddfbaa..490dd1db55 100644 --- a/api/js/framework/fw_base.js +++ b/api/js/framework/fw_base.js @@ -563,6 +563,10 @@ var fw_base = (function(){ "use strict"; return Class.extend( //As a new tab might remove a row from the tab header, we have to resize all tab content browsers this.tag.parentFw.resizeHandler(); + if (app.appName.match(/:/)) + { + app.destroy(); + } }, /** @@ -676,9 +680,9 @@ var fw_base = (function(){ "use strict"; return Class.extend( var app = this.parseAppFromUrl(_link); if (app) { - // add target flag - _link += '&target=_tab'; var appname = app.appName+":"+(_extra.id ? _extra.id : btoa(_link)); + // add target flag + _link += '&target='+appname; // create an actual clone of existing app object this.applications[appname] = jQuery.extend(true, {}, app); // merge extra framework app data into the new one @@ -687,6 +691,10 @@ var fw_base = (function(){ "use strict"; return Class.extend( this.applications[appname]['indexUrl'] = _link; this.applications[appname]['tab'] = null; // must be rest to create a new tab this.applications[appname]['browser'] = null; // must be rest to create a new browser content + this.applications[appname]['sidemenuEntry'] = this.sidemenuUi.addEntry( + this.applications[appname].displayName, this.applications[appname].icon, + this.applicationClickCallback, this.applications[appname], appname); + this.applicationTabNavigate(this.applications[appname], _link, false, -1, null); } diff --git a/api/js/framework/fw_classes.js b/api/js/framework/fw_classes.js index e18ac247b0..84293d5319 100644 --- a/api/js/framework/fw_classes.js +++ b/api/js/framework/fw_classes.js @@ -51,6 +51,18 @@ function egw_fw_class_application(_parentFw, _appName, _displayName, _icon, this.browser = null; } +/** + * destroy application object and its relative parts + */ +egw_fw_class_application.prototype.destroy = function() +{ + delete this.tab; + if (this.sidemenuEntry) this.sidemenuEntry.remove(); + delete this.sidemenuEntry; + delete this.browser; + delete (framework.applications[this.appName]); +}; + /** * Returns an menuaction inside the jdots_framework for this application. * without a "this" context (by directly calling egw_fw_class_application.prototype.getAjaxUrl)