Skip to main content

Search and Top Navigation

#6065 closed bug (worksforme)

Opened September 17, 2010 06:52PM UTC

Closed September 17, 2010 07:35PM UTC

Last modified October 11, 2012 09:15PM UTC

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();
    }
  }
});
Attachments (0)
Change History (3)

Changed September 17, 2010 07:35PM UTC by scottgonzalez comment:1

resolution: → worksforme
status: newclosed

Works for me: http://jsbin.com/ojuni3

Changed September 17, 2010 08:04PM UTC by rdworth comment:2

From http://docs.jquery.com/UI/Dialog#option-closeText

"Note that the close text is visibly hidden when using a standard theme."

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:3

milestone: TBD

Milestone TBD deleted