Changeset 116 for trunk/common/Dialog.js
- Timestamp:
- 02/01/07 22:38:21 (3 years ago)
- Files:
-
- 1 modified
-
trunk/common/Dialog.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/Dialog.js
r94 r116 98 98 open: function() { 99 99 Dialog.Message.superClass.open.apply( this, arguments ); 100 var messageElement = DOM.getElement( this.element.id + "-message" ); 101 if ( typeof this.data == 'string' ) 100 if( typeof this.data == "string" ) 102 101 this.data = { message: this.data }; 103 104 if( messageElement)105 messageElement.innerHTML = this.data.message;102 var e = DOM.getElement( this.element.id + "-message" ); 103 if( e ) 104 e.innerHTML = this.data.message; 106 105 } 107 106 } ); … … 208 207 209 208 setFirstInput: function() { 210 if ( !this.firstInput )209 if( !this.firstInput ) 211 210 this.firstInput = this.getFirstSpecifiedInput( this.element, this.data, null ); 212 211 }, … … 214 213 215 214 selectFirstInput: function() { 216 if ( this.firstInput && this.firstInput.select )215 if( this.firstInput && this.firstInput.select ) 217 216 this.firstInput.select(); 218 217 }, … … 243 242 open: function( data, callback ) { 244 243 Dialog.Simple.superClass.open.apply( this, arguments ); 245 if( !this.data ) 246 this.data = {}; 244 if( typeof this.data == "string" ) 245 this.data = { message: this.data }; 246 var e = DOM.getElement( this.element.id + "-message" ); 247 if( e ) 248 e.innerHTML = this.data.message; 249 247 250 this.firstInput = null; 248 251 DOM.setFormData( this.element, this.data ); … … 250 253 this.focusFirstInput(); 251 254 } 252 253 255 } ); 254 255
