Skip to main content

Search and Top Navigation

#3692 closed bug (notabug)

Opened December 23, 2008 04:14AM UTC

Closed December 31, 2008 08:30PM UTC

Last modified October 11, 2012 09:15PM UTC

Dialog does not display when reopened

Reported by: jburgess Owned by:
Priority: major Milestone:
Component: ui.dialog Version: 1.6rc2
Keywords: Cc:
Blocked by: Blocking:
Description

If I open a dialog box, close it, and then try to re-open it again, the dialog is displayed the first time but not the second time. When the dialog opens the second time, the titlebar is visible but the main dialog contents are not.

My code is as follows:

(dialog html)

          <div class='dialog_wrapper' style='display: none;'>
            <div class='dialog'>
                w00t
            </div>
          </div>

(dialog display code)

          <script type='text/javascript'>
            //<![CDATA[
              function open_dialog() {
                jQuery(".dialog_wrapper").dialog({
                    draggable: false,
                    height: 265,
                    width: 350,
                    modal: true,
                    overlay: { 
                        opacity: 0.5, 
                        background: "#000000" 
                    },
                    resizable: false
                }).show();
              }
            //]]>
          </script>

(the link)

          <a href='#' onClick='open_dialog();'>Open dialog</a>

I took a cursory glance, and it appears that the wrapper divs are not being removed when the dialog is closed. Perhaps that is the problem?

Attachments (0)
Change History (3)

Changed December 23, 2008 11:18AM UTC by wichert comment:1

They are only removed if you ''destroy'' the dialog. If you only close the dialog you can reopen it by issuing a ''show'' command.

Changed December 31, 2008 08:30PM UTC by scottgonzalez comment:2

resolution: → invalid
status: newclosed

Wichart is correct. You cannot re-initialize a dialog if it hasn't been destroyed. What you probably want to do is initialize the dialog with autoOpen: false and then have your link call $('.dialog_wrapper').dialog('open');

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

milestone: TBD

Milestone TBD deleted