From: <ga...@us...> - 2010-09-23 01:34:12
|
Revision: 4755 http://jaffa.svn.sourceforge.net/jaffa/?rev=4755&view=rev Author: gautamj Date: 2010-09-23 01:34:05 +0000 (Thu, 23 Sep 2010) Log Message: ----------- Corrected the adjustInputFileBox() method to apply different adjustments to the fileInputBox, based on whether it is being initially rendered or not. Modified Paths: -------------- trunk/JaffaRIA/source/html/js/extjs/ux/maximgb/uploaddialog/UploadDialog.js Modified: trunk/JaffaRIA/source/html/js/extjs/ux/maximgb/uploaddialog/UploadDialog.js =================================================================== --- trunk/JaffaRIA/source/html/js/extjs/ux/maximgb/uploaddialog/UploadDialog.js 2010-09-22 23:02:31 UTC (rev 4754) +++ trunk/JaffaRIA/source/html/js/extjs/ux/maximgb/uploaddialog/UploadDialog.js 2010-09-23 01:34:05 UTC (rev 4755) @@ -274,13 +274,13 @@ onRender : function(ct, position) { Ext.ux.UploadDialog.BrowseButton.superclass.onRender.call(this, ct, position); - this.createInputFile(); + this.createInputFile(true); }, /** * @access private */ - createInputFile : function() + createInputFile : function(onRender) { var button_container = this.el.child('.x-btn-mc'); button_container.position('relative'); @@ -297,7 +297,7 @@ ); this.input_file.setOpacity(0.0); - this.adjustInputFileBox(); + this.adjustInputFileBox(onRender); if (this.handleMouseEvents) { this.input_file.on('mouseover', this.onMouseOver, this); @@ -317,34 +317,39 @@ this.input_file.on('click', function(e) { e.stopPropagation(); }); }, - /** + /** * @access private */ autoWidth : function() { Ext.ux.UploadDialog.BrowseButton.superclass.autoWidth.call(this); - this.adjustInputFileBox(); + this.adjustInputFileBox(); }, - /** + /** * @access private */ - adjustInputFileBox : function() + adjustInputFileBox : function(onRender) { - var btn_cont, btn_box, inp_box, adj; + var btn_cont, btn_box, inp_box, adj; - if (this.el && this.input_file) { + if (this.el && this.input_file) { btn_cont = this.el.child('.x-btn-mc'); btn_box = btn_cont.getBox(); this.input_file.setStyle('font-size', (btn_box.width * 0.5) + 'px'); inp_box = this.input_file.getBox(); adj = {x: 24, y: 8} if (Ext.isIE) { - adj = {x: 0, y: 3} - } + // For IE, adjustments required during initial rendering and during subsequent creation of inputFileBox are different + if (onRender) + adj = {x: 20, y: -8}; + else + adj = {x: 3, y: 3}; + this.input_file.setHeight(btn_box.height + 10); + } this.input_file.setLeft(btn_box.width - inp_box.width + adj.x + 'px'); - this.input_file.setTop(btn_box.height - inp_box.height + adj.y + 'px'); - } + this.input_file.setTop(btn_box.height - inp_box.height + adj.y + 'px'); + } }, /** @@ -684,12 +689,12 @@ } ], 'file-upload-start' : [ - { - predicate: this.fireBeforeFileUploadStartEvent, - action: [this.uploadFile, this.findUploadFrame, this.fireFileUploadStartEvent] - }, { - action: this.postFileUploadCancelEvent + predicate: this.fireBeforeFileUploadStartEvent, + action: [this.uploadFile, this.findUploadFrame, this.fireFileUploadStartEvent] + }, + { + action: this.postFileUploadCancelEvent } ], 'file-upload-success' : [ @@ -744,21 +749,21 @@ } ], 'file-upload-canceled' : [ - { - predicate: this.hasUnuploadedFiles, - action: [ - this.setRecordCanceledState, this.updateProgressBar, this.prepareNextUploadTask, - this.fireUploadCanceledEvent - ] - }, - { - action: [ - this.resetUploadingFlag, this.setRecordCanceledState, - this.updateToolbar, this.updateProgressBar, - this.fireUploadCanceledEvent, this.fireUploadCompleteEvent - ], - state: 'ready' - } + { + predicate: this.hasUnuploadedFiles, + action: [ + this.setRecordCanceledState, this.updateProgressBar, this.prepareNextUploadTask, + this.fireUploadCanceledEvent + ] + }, + { + action: [ + this.resetUploadingFlag, this.setRecordCanceledState, + this.updateToolbar, this.updateProgressBar, + this.fireUploadCanceledEvent, this.fireUploadCompleteEvent + ], + state: 'ready' + } ], 'hide' : [ { @@ -1240,24 +1245,24 @@ fireBeforeFileUploadStartEvent : function(record) { - return this.fireEvent('beforefileuploadstart', this, record.get('filename'), record) !== false; + return this.fireEvent('beforefileuploadstart', this, record.get('filename'), record) !== false; }, postFileUploadCancelEvent : function(record) { - this.fsa.postEvent('file-upload-canceled', record); + this.fsa.postEvent('file-upload-canceled', record); }, setRecordCanceledState : function(record) { - record.set('state', Ext.ux.UploadDialog.FileRecord.STATE_FAILED); - record.set('note', this.i18n.note_canceled); - record.commit(); + record.set('state', Ext.ux.UploadDialog.FileRecord.STATE_FAILED); + record.set('note', this.i18n.note_canceled); + record.commit(); }, fireUploadCanceledEvent : function(record) { - this.fireEvent('uploadcanceled', this, record.get('filename'), record); + this.fireEvent('uploadcanceled', this, record.get('filename'), record); }, fireFileUploadStartEvent : function(record) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |