Changeset 116 for trunk/common/Dialog.js

Show
Ignore:
Timestamp:
02/01/07 22:38:21 (3 years ago)
Author:
ydnar
Message:

added message support to Dialog.Simple; going to phase out Dialog.Message and Dialog.Simple in favor of just Dialog in a future commit; bugid:47041

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/common/Dialog.js

    r94 r116  
    9898    open: function() { 
    9999        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" ) 
    102101            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; 
    106105    } 
    107106} ); 
     
    208207 
    209208    setFirstInput: function() { 
    210         if ( !this.firstInput ) 
     209        if( !this.firstInput ) 
    211210            this.firstInput = this.getFirstSpecifiedInput( this.element, this.data, null ); 
    212211    }, 
     
    214213 
    215214    selectFirstInput: function() { 
    216         if ( this.firstInput && this.firstInput.select ) 
     215        if( this.firstInput && this.firstInput.select ) 
    217216            this.firstInput.select(); 
    218217    }, 
     
    243242    open: function( data, callback ) { 
    244243        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         
    247250        this.firstInput = null; 
    248251        DOM.setFormData( this.element, this.data ); 
     
    250253        this.focusFirstInput(); 
    251254    } 
    252  
    253255} ); 
    254  
    255