Changeset 1090

Show
Ignore:
Timestamp:
12/10/08 18:25:51 (12 months ago)
Author:
scott.gonzalez
Message:

Dialog: Fixed #3638: Added closeText option (default 'close').

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/dialog.js

    r1045 r1090  
    1111        autoResize: true, 
    1212        buttons: {}, 
     13        closeOnEscape: true, 
     14        closeText: 'close', 
    1315        disabled: false, 
    1416        dialogClass: undefined, 
     
    327329}); 
    328330 
     331test("closeOnEscape", function() { 
     332        ok(false, 'missing test'); 
     333}); 
     334 
     335test("closeText", function() { 
     336        expect(3); 
     337 
     338        el = $('<div></div>').dialog(); 
     339                equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'close', 
     340                        'default close text'); 
     341        el.remove(); 
     342 
     343        el = $('<div></div>').dialog({ closeText: "foo" }); 
     344                equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'foo', 
     345                        'closeText on init'); 
     346        el.remove(); 
     347 
     348        el = $('<div></div>').dialog().dialog('option', 'closeText', 'bar'); 
     349                equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'bar', 
     350                        'closeText via option method'); 
     351        el.remove(); 
     352}); 
     353 
    329354test("dialogClass", function() { 
    330355        expect(4); 
  • trunk/ui/ui.dialog.js

    r1045 r1090  
    6464 
    6565                        uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>')) 
    66                                 .html('X') 
     66                                .text(options.closeText) 
    6767                                .appendTo(uiDialogTitlebarClose), 
    6868 
     
    360360                                this._createButtons(value); 
    361361                                break; 
     362                        case "closeText": 
     363                                this.uiDialogTitlebarCloseText.text(value); 
     364                                break; 
    362365                        case "draggable": 
    363366                                (value 
     
    419422                buttons: {}, 
    420423                closeOnEscape: true, 
     424                closeText: 'close', 
    421425                draggable: true, 
    422426                height: 200,