diff --git a/js/app/controllers/DownloadModule.js b/js/app/controllers/DownloadModule.js index 38d3ec9..12f5cc4 100644 --- a/js/app/controllers/DownloadModule.js +++ b/js/app/controllers/DownloadModule.js @@ -29,7 +29,7 @@ Ext.define('amdaDesktop.DownloadModule', { * @required */ width: 600, - height: 650, + height: 620, uiType : 'panelDownload', helpTitle : 'Help on Download Module', helpFile : 'downloadHelp', diff --git a/js/app/views/DownloadUI.js b/js/app/views/DownloadUI.js index 2781348..ffc3aa6 100644 --- a/js/app/views/DownloadUI.js +++ b/js/app/views/DownloadUI.js @@ -60,6 +60,11 @@ Ext.define('amdaUI.DownloadUI', { return; } + if ((this.object.get('id') != '') && (downloadModule.linkedNode.get('text') == this.object.get('name'))) { + this.saveProcess(false); + return; + } + downloadModule.linkedNode.isValidName(this.fieldName.getValue(), function (res) { if (!res) { @@ -78,7 +83,11 @@ Ext.define('amdaUI.DownloadUI', { msg: res.error+'<br/>Do you want to overwrite it?', width: 300, buttons: Ext.MessageBox.OKCANCEL, - fn : me.overwriteProcess, + fn : function(btn) { + if (btn == 'cancel') return; + this.fieldName.clearInvalid(); + this.saveProcess(true); + }, icon: Ext.MessageBox.WARNING, scope : me }); @@ -704,8 +713,7 @@ Ext.define('amdaUI.DownloadUI', { data: this.timeformatData }); - this.paramPanel = { - xtype: 'container', + this.paramPanel = new Ext.container.Container({ title: 'Parameters', layout: { type: 'hbox', @@ -721,12 +729,7 @@ Ext.define('amdaUI.DownloadUI', { align: 'stretch' }, items: [ - { - xtype: 'textfield', - fieldLabel: 'Request Name', - disabled: true, - name: 'name' - }, + this.fieldName, { xtype: 'splitter', flex: 0.05 @@ -817,11 +820,10 @@ Ext.define('amdaUI.DownloadUI', { store: this.filecompressData, value: this.filecompressData[0] }, - this.fieldName, this.timeSelector ] } - ]}; + ]}); this.ttPanel = { @@ -885,8 +887,16 @@ Ext.define('amdaUI.DownloadUI', { items: [ this.paramPanel, this.ttPanel - ] - }], + ], + listeners: { + tabchange: function(tabPanel, newCard, oldCard, eOpts) { + var saveBtn = this.down('#save-download'); + saveBtn.setDisabled(newCard != this.paramPanel); + }, + scope: this + } + }, + ], fbar: [ { text: 'Download', @@ -918,6 +928,7 @@ Ext.define('amdaUI.DownloadUI', { }, { text: 'Save', + id: 'save-download', scope: this, handler: function () { this.saveRequest(); -- libgit2 0.21.2