Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#6065 closed bug (worksforme)

closeText does not appear

Reported by: rmariuzzo Owned by:
Priority: major Milestone:
Component: ui.dialog Version: 1.8.4
Keywords: closeText, dialog, workaround Cc:
Blocked by: Blocking:

Description

The closeText's jQuery UI Dialog option does not work when set. For example:

$('.selector').click(function(){
  $('#line-info').dialog({
    closeText: 'close'
  });
});

This previous code does not work. A workaround that I am using is this:

$('.ui-dialog').live('dialogopen', function(event, ui) {
  var $this = $(this);
  var $icon = $this.find('.ui-dialog-titlebar-close .ui-icon');
  if ($icon && !$icon.is(':empty')) {
    var $closetext = $this.find('.ui-dialog-closetext');
    if ($closetext.length > 0) {
      $closetext.text($icon.text());
    } else {
      $icon.after('<span class="ui-dialog-closetext">' + $icon.text() + '</span>').empty();
    }
  }
});

Change History (3)

comment:1 Changed 9 years ago by Scott González

Resolution: worksforme
Status: newclosed

comment:2 Changed 9 years ago by rdworth

From http://docs.jquery.com/UI/Dialog#option-closeText "Note that the close text is visibly hidden when using a standard theme."

comment:3 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.