From 082d7fddad9760c5e159b2beecdc8f23b7a725b7 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 2 Nov 2020 13:12:31 +0100 Subject: [PATCH] Remove closed tabs from the client-side session --- api/js/framework/fw_base.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/api/js/framework/fw_base.js b/api/js/framework/fw_base.js index df101b2fe3..4c8f187dd1 100644 --- a/api/js/framework/fw_base.js +++ b/api/js/framework/fw_base.js @@ -571,6 +571,13 @@ var fw_base = (function(){ "use strict"; return Class.extend( { app.destroy(); } + + this.tag.parentFw.tabApps.forEach((a,i)=>{if (a.name == this.tag.appName) + { + this.tag.parentFw.tabApps.splice(i,1); + return; + }}); + this.tag.parentFw._setTabAppsSession(this.tag.parentFw.tabApps); }, /** @@ -679,6 +686,14 @@ var fw_base = (function(){ "use strict"; return Class.extend( } }, + _setTabAppsSession: function(_tabApps) + { + if (_tabApps) + { + egw.setSessionItem('api', 'fw_tab_apps', JSON.stringify(_tabApps)); + } + }, + tabLinkHandler: function(_link, _extra) { var app = this.parseAppFromUrl(_link); @@ -720,7 +735,7 @@ var fw_base = (function(){ "use strict"; return Class.extend( internalName: app.appName })); - egw.setSessionItem('api', 'fw_tab_apps', JSON.stringify(this.tabApps)); + this._setTabAppsSession(this.tabApps); } else {