From bdcdb5268a1c5bf56fdf2ba3a8d8fa79e7e8bcd3 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 9 May 2019 11:36:26 +0200 Subject: [PATCH] Implements action to add plot tabs in current plot request --- js/app/models/PlotNode.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/js/app/models/PlotNode.js b/js/app/models/PlotNode.js index d796a52..267dc46 100644 --- a/js/app/models/PlotNode.js +++ b/js/app/models/PlotNode.js @@ -76,6 +76,10 @@ Ext.define('amdaModel.PlotNode', { }, { fnId : 'leaf-deleteNode', text : 'Delete Request' + }, { + fnId : 'leaf-insertTabs', + text : 'Insert in current Plot Request' + }]; return menuItems; @@ -124,7 +128,8 @@ Ext.define('amdaModel.PlotNode', { case 'deleteMulti': this.deleteMulti(); break; - + case 'insertTabs': + this.insertPlotTabsRequest(); default: break; } @@ -140,6 +145,24 @@ Ext.define('amdaModel.PlotNode', { var isFolder = (!this.isLeaf()) && (this.get('tabs') === false); var dataToSend = {id : this.get('id'), old_name: this.get('name'), name: this.get('name'), parent : parentId, leaf: !isFolder, nodeType: this.get('nodeType')}; AmdaAction.renameObject(dataToSend, callBackFn); + }, + + insertPlotTabsRequest: function() { + var me = this; + AmdaAction.getObject(me.get('id'), me.get('nodeType'), function (result,remoteEvent) { + var paramObj = Ext.create(me.get('objectDataModel'), result); + myDesktopApp.getLoadedModule(me.get('moduleId'), true, function (module) { + module.createWindow(function () { + var uiContent = module.getUiContent(); + if (uiContent != null) { + paramObj.tabs().each(function (tab) { + var tabData = tab.getJsonValues(); + uiContent.insertPlotTab(tabData); + }); + } + }); + }); + }); } }); -- libgit2 0.21.2