Commit 7510dd4a449b1b250869ab7f77191629a16e557c

Authored by Erdogan Furkan
1 parent 831a82fa

#10285 - Done

Showing 1 changed file with 34 additions and 16 deletions   Show diff stats
js/app/views/PlotComponents/PlotOutputForm.js
@@ -16,7 +16,7 @@ Ext.define('amdaPlotComp.PlotOutputForm', { @@ -16,7 +16,7 @@ Ext.define('amdaPlotComp.PlotOutputForm', {
16 setObject : function(object) { 16 setObject : function(object) {
17 this.object = object; 17 this.object = object;
18 this.loadRecord(this.object); 18 this.loadRecord(this.object);
19 - this.updateOutputOption(this.object.get('file-format')); 19 + this.updateOutputOption(this.object.get('file-format'),this.object.get('file-output'));
20 this.updateOneFilePerIntOption(this.object.get('file-format')); 20 this.updateOneFilePerIntOption(this.object.get('file-format'));
21 this.updateFilePrefixOption(this.object.get('file-output')); 21 this.updateFilePrefixOption(this.object.get('file-output'));
22 }, 22 },
@@ -35,22 +35,40 @@ Ext.define('amdaPlotComp.PlotOutputForm', { @@ -35,22 +35,40 @@ Ext.define('amdaPlotComp.PlotOutputForm', {
35 prefixField.setDisabled(output == 'INTERACTIVE'); 35 prefixField.setDisabled(output == 'INTERACTIVE');
36 }, 36 },
37 37
38 - updateOutputOption : function(format) { 38 + updateOutputOption : function(format,output) {
39 var outputField = this.getForm().findField('file-output'); 39 var outputField = this.getForm().findField('file-output');
40 -  
41 - if (format == 'PNG')  
42 - {  
43 - outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForPng);  
44 - outputField.setValue('INTERACTIVE');  
45 - }  
46 - else  
47 - {  
48 - outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForOtherFormats);  
49 - if (outputField.getValue() == 'INTERACTIVE')  
50 - outputField.setValue('TGZ');  
51 - else  
52 - outputField.setValue('TGZ');  
53 - } 40 + var outputValue = outputField.getValue();
  41 +
  42 + if(format == 'PNG')
  43 + {
  44 + outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForPng);
  45 + if(!output)
  46 + {
  47 + if(!outputValue)
  48 + outputField.setValue('INTERACTIVE');
  49 + else
  50 + outputField.setValue(outputValue);
  51 + }
  52 + else
  53 + {
  54 + outputField.setValue(output);
  55 + }
  56 + }
  57 + else
  58 + {
  59 + outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForOtherFormats);
  60 + if(!output)
  61 + {
  62 + if(outputValue =='INTERACTIVE' || !outputValue)
  63 + outputField.setValue('TGZ');
  64 + else
  65 + outputField.setValue(outputValue);
  66 + }
  67 + else
  68 + {
  69 + outputField.setValue(output);
  70 + }
  71 + }
54 }, 72 },
55 73
56 getFormItems: function() { 74 getFormItems: function() {