From e27eecbd4eca3eb48cdea4f4ce3d0def8f41addd Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 16 Sep 2015 16:22:28 +0200 Subject: [PATCH] Save and load TT list for a plot request --- js/app/views/PlotComponents/PlotTabContent.js | 6 ++++++ js/app/views/PlotComponents/PlotTree.js | 30 ------------------------------ js/app/views/PlotUI.js | 8 ++++++++ 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/js/app/views/PlotComponents/PlotTabContent.js b/js/app/views/PlotComponents/PlotTabContent.js index e1130ee..c9f6763 100644 --- a/js/app/views/PlotComponents/PlotTabContent.js +++ b/js/app/views/PlotComponents/PlotTabContent.js @@ -39,6 +39,12 @@ Ext.define('amdaPlotComp.PlotTabContent', { this.object = object; this.treePlot.buildTree(this.object); this.timeSelector.intervalSel.setInterval(this.object.get('startDate'), this.object.get('stopDate')); + this.addTTs(this.object.get('timeTables')); + }, + + addTTs : function(TTarray) { + // set TTTab + this.timeSelector.setTTTab(TTarray); }, updateLinkedToMultiPlotMode : function (isLinkedToMultiPlotMode) { diff --git a/js/app/views/PlotComponents/PlotTree.js b/js/app/views/PlotComponents/PlotTree.js index dd86fbd..f97225d 100644 --- a/js/app/views/PlotComponents/PlotTree.js +++ b/js/app/views/PlotComponents/PlotTree.js @@ -426,36 +426,6 @@ Ext.define('amdaPlotComp.PlotTree', { return true; } return false; - - /*var fromIndex = targetNode.parentNode.indexOf(record); - var toIndex = targetNode.parentNode.indexOf(targetNode); - - var fromRecord = this.tabObject.panels().getAt(fromIndex); - if (!fromRecord) - return false; - - switch (position) - { - case 'before' : - this.tabObject.panels().data.removeAt(fromIndex); - var insertIndex = (fromIndex > toIndex) ? toIndex : toIndex - 1; - this.tabObject.panels().data.insert(insertIndex, fromRecord); - this.buildPanelsNode(); - this.getSelectionModel().select(this.panelsNode.getChildAt(insertIndex)); - return true; - case 'after' : - this.tabObject.panels().data.removeAt(fromIndex); - var insertIndex = (fromIndex > toIndex) ? toIndex + 1 : toIndex; - this.tabObject.panels().data.insert(insertIndex, fromRecord); - this.buildPanelsNode(); - this.getSelectionModel().select(this.panelsNode.getChildAt(insertIndex)); - return true; - break; - default : - return false; - }*/ - - return true; }, onNodeSelect: function(tree, record, index, eOpts) { diff --git a/js/app/views/PlotUI.js b/js/app/views/PlotUI.js index 795c4f6..f35dae6 100644 --- a/js/app/views/PlotUI.js +++ b/js/app/views/PlotUI.js @@ -44,6 +44,7 @@ Ext.define('amdaUI.PlotUI', { this.plotOutput.setObject(this.object); this.plotTabs.setRequestObject(this.object); this.timeSelector.intervalSel.setInterval(this.object.get('startDate'), this.object.get('stopDate')); + this.addTTs(this.object.get('timeTables')); }, saveProcess : function() { @@ -51,6 +52,8 @@ Ext.define('amdaUI.PlotUI', { if (!plotModule) return; + this.updateObject(); + if ((this.object.get('id') != '') && (plotModule.linkedNode.get('text') == this.object.get('name'))) //update existing request plotModule.linkedNode.update(); @@ -150,6 +153,11 @@ Ext.define('amdaUI.PlotUI', { if (crtTimeSelector) crtTimeSelector.addTT(newTTName,newTTid); }, + + addTTs : function(TTarray) { + // set TTTab + this.timeSelector.setTTTab(TTarray); + }, /** * Set Start-Stop from parameter info (Local & MyData) -- libgit2 0.21.2