diff --git a/js/app/views/PlotComponents/PlotOutputForm.js b/js/app/views/PlotComponents/PlotOutputForm.js index babee9a..9ca1191 100644 --- a/js/app/views/PlotComponents/PlotOutputForm.js +++ b/js/app/views/PlotComponents/PlotOutputForm.js @@ -16,7 +16,7 @@ Ext.define('amdaPlotComp.PlotOutputForm', { setObject : function(object) { this.object = object; this.loadRecord(this.object); - this.updateOutputOption(this.object.get('file-format')); + this.updateOutputOption(this.object.get('file-format'),this.object.get('file-output')); this.updateOneFilePerIntOption(this.object.get('file-format')); this.updateFilePrefixOption(this.object.get('file-output')); }, @@ -35,22 +35,40 @@ Ext.define('amdaPlotComp.PlotOutputForm', { prefixField.setDisabled(output == 'INTERACTIVE'); }, - updateOutputOption : function(format) { + updateOutputOption : function(format,output) { var outputField = this.getForm().findField('file-output'); - - if (format == 'PNG') - { - outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForPng); - outputField.setValue('INTERACTIVE'); - } - else - { - outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForOtherFormats); - if (outputField.getValue() == 'INTERACTIVE') - outputField.setValue('TGZ'); - else - outputField.setValue('TGZ'); - } + var outputValue = outputField.getValue(); + + if(format == 'PNG') + { + outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForPng); + if(!output) + { + if(!outputValue) + outputField.setValue('INTERACTIVE'); + else + outputField.setValue(outputValue); + } + else + { + outputField.setValue(output); + } + } + else + { + outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForOtherFormats); + if(!output) + { + if(outputValue =='INTERACTIVE' || !outputValue) + outputField.setValue('TGZ'); + else + outputField.setValue(outputValue); + } + else + { + outputField.setValue(output); + } + } }, getFormItems: function() { -- libgit2 0.21.2