Commit d8919d7897ede14e2be697ead872b43fa0c67a01

Authored by Hacene SI HADJ MOHAND
1 parent d675a6e8

corrections before merging

js/app/models/PlotObjects/PlotPanelObject.js
... ... @@ -280,7 +280,7 @@ Ext.define('amdaPlotObj.PlotPanelObject', {
280 280 }
281 281 },
282 282  
283   - createNewParam: function(paramId, paramComponents, isVector, plotOnly, onAfterCreate) {
  283 + createNewParam: function(paramId, paramComponents, isVector, is2d, plotOnly, onAfterCreate) {
284 284 this.set('last-param-id', this.get('last-param-id') + 1);
285 285  
286 286 var emptyPanel = (this.params().getCount() == 0);
... ... @@ -304,7 +304,9 @@ Ext.define('amdaPlotObj.PlotPanelObject', {
304 304 recs[0].set('dim2-index', paramComponents['index2']);
305 305 }
306 306 }
307   -
  307 +
  308 + if (is2d)
  309 + recs[0].set('dim2-index','0');
308 310 // activate legend if vector & TimePlot
309 311 if ( isVector && this.get('panel-plot-type') == 'timePlot' ) {
310 312 this.loadSeriesLegend();
... ...
js/app/views/PlotComponents/PlotTree.js
... ... @@ -607,7 +607,7 @@ Ext.define('amdaPlotComp.PlotTree', {
607 607 return false;
608 608 },
609 609  
610   - dropParamToCreate: function (targetNode, position, paramId, paramComponents, isVector, plotOnly)
  610 + dropParamToCreate: function (targetNode, position, paramId, paramComponents, isVector, is2d, plotOnly)
611 611 {
612 612 var panelObject = null;
613 613 if (targetNode == null)
... ... @@ -640,7 +640,7 @@ Ext.define('amdaPlotComp.PlotTree', {
640 640  
641 641 //Create param object
642 642 var me = this;
643   - panelObject.createNewParam(paramId, paramComponents, isVector, plotOnly, function (newParamObject) {
  643 + panelObject.createNewParam(paramId, paramComponents, isVector, is2d, plotOnly, function (newParamObject) {
644 644 //Rebuild params node
645 645 me.buildPanelsNode(newParamObject.getId());
646 646 //BRE newParamObject
... ... @@ -669,6 +669,7 @@ Ext.define('amdaPlotComp.PlotTree', {
669 669 this.dropParamToCreate(targetNode, position, "#" + record.get('alias'));
670 670 else {
671 671 var isVector = record.get('iconCls') == 'icon-vector';
  672 + var is2d = recod.get('iconCls') == 'icon-2dspectra';
672 673 var component_info = record.get('component_info');
673 674 var param_id = record.get('id');
674 675 var plot_only = record.get('notyet');
... ... @@ -682,7 +683,7 @@ Ext.define('amdaPlotComp.PlotTree', {
682 683 if (component_info.index2)
683 684 components['index2'] = component_info.index2;
684 685 }
685   - this.dropParamToCreate(targetNode, position, param_id, components, isVector, plot_only);
  686 + this.dropParamToCreate(targetNode, position, param_id, components, isVector, is2d, plot_only);
686 687 }
687 688 return true;
688 689 case 'amdaModel.AliasNode' :
... ...