Commit ae185f403e6c51c8cf4a4e2f494da047269d677f
1 parent
b60c5d14
Exists in
master
and in
88 other branches
Fix multiplot (#8314)
Showing
3 changed files
with
23 additions
and
2 deletions
Show diff stats
js/app/views/MultiPlotUI.js
@@ -33,10 +33,12 @@ Ext.define('amdaUI.MultiPlotUI', { | @@ -33,10 +33,12 @@ Ext.define('amdaUI.MultiPlotUI', { | ||
33 | listeners: { | 33 | listeners: { |
34 | change: function(field, newValue, oldValue, eOpts) { | 34 | change: function(field, newValue, oldValue, eOpts) { |
35 | tabInfo.object.set('multi-selected', newValue); | 35 | tabInfo.object.set('multi-selected', newValue); |
36 | + tabInfo.tabContent.enableTimeSelection(!newValue); | ||
36 | } | 37 | } |
37 | } | 38 | } |
38 | } | 39 | } |
39 | ); | 40 | ); |
41 | + tabInfo.tabContent.enableTimeSelection(!tabInfo.object.get('multi-selected')); | ||
40 | }); | 42 | }); |
41 | }, | 43 | }, |
42 | 44 |
js/app/views/PlotComponents/PlotTabPanel.js
@@ -203,7 +203,8 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | @@ -203,7 +203,8 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | ||
203 | tabsInfo.push({ | 203 | tabsInfo.push({ |
204 | name: plotNode.get('object').get('tab-title'), | 204 | name: plotNode.get('object').get('tab-title'), |
205 | object: plotNode.get('object'), | 205 | object: plotNode.get('object'), |
206 | - selected: (tabItem == this.getActiveTab()) | 206 | + selected: (tabItem == this.getActiveTab()), |
207 | + tabContent: tabContent | ||
207 | }); | 208 | }); |
208 | } | 209 | } |
209 | return tabsInfo; | 210 | return tabsInfo; |
@@ -250,6 +251,22 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | @@ -250,6 +251,22 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | ||
250 | me.tabbar_destroy = true; | 251 | me.tabbar_destroy = true; |
251 | } | 252 | } |
252 | } | 253 | } |
254 | + }, | ||
255 | + listeners: { | ||
256 | + tabchange: function(tabPanel, newCard, oldCard, eOpts) { | ||
257 | + if (newCard) { | ||
258 | + var newTree = this.getTreeFromPlotTab(newCard); | ||
259 | + if (newTree) { | ||
260 | + if (newTree.plotElementPanel != null) { | ||
261 | + var selectedNode = newTree.getSelectedNode(); | ||
262 | + if (selectedNode != null) { | ||
263 | + newTree.plotElementPanel.setElement(selectedNode.type, selectedNode.object, newTree); | ||
264 | + } | ||
265 | + } | ||
266 | + } | ||
267 | + } | ||
268 | + }, | ||
269 | + scope: this | ||
253 | } | 270 | } |
254 | }; | 271 | }; |
255 | 272 |
js/app/views/PlotUI.js
@@ -152,7 +152,9 @@ Ext.define('amdaUI.PlotUI', { | @@ -152,7 +152,9 @@ Ext.define('amdaUI.PlotUI', { | ||
152 | var plotButton = this.queryById('single-plot-button'); | 152 | var plotButton = this.queryById('single-plot-button'); |
153 | plotButton.setDisabled(!enable); | 153 | plotButton.setDisabled(!enable); |
154 | plotButton.setTooltip(enable ? 'Plot request' : 'Multiplot is enabled'); | 154 | plotButton.setTooltip(enable ? 'Plot request' : 'Multiplot is enabled'); |
155 | - this.plotTabs.enableTimeSelection(enable); | 155 | + if (enable) { |
156 | + this.plotTabs.enableTimeSelection(true); | ||
157 | + } | ||
156 | }, | 158 | }, |
157 | 159 | ||
158 | init : function(config) { | 160 | init : function(config) { |