#5887 closed bug (notabug)
Dialog: Removing existing dialog data on init
Reported by: | rozwell | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.dialog | Version: | 1.8.2 |
Keywords: | remove, existing, dialog, box, init, hidden, data | Cc: | |
Blocked by: | Blocking: |
Description
If you init dialog, it will add it's hidden box at the end of documents body. What is ok, it's supposed to act like this.
But if you do this on ajax based site, it will keep adding new boxes over and over again on every (for example) tab change. And with tab change I mean calling some function (like $.ajax) to reload some part of a page. This will cause displaying different hidden box on every dialog('open') call.
Hidden dialog box (for specific id) should be removed on every init to avoid situation described above.
If it breaks some assumptions, I suggest adding a boolean option to clear already existing hidden data.
Note: See
TracTickets for help on using
tickets.
You need to either manually destroy the dialog yourself, or move it back to the original location on close. We're going to add an appendTo option to change where the dialog is placed in a future version.