Skip to content
This repository has been archived by the owner on Dec 1, 2017. It is now read-only.

Allow the dialog content to stay in DOM after the dialog window is closed #64

Closed
wants to merge 6 commits into from

Conversation

DemitryT
Copy link

I found that in some use cases removing the dialog content from the DOM after close displayed some funkiness in re-opening the dialog. In my specific case, I dynamically added hidden content into the DOM and only displayed it when a dialog was opened. Then when the dialog is closed and the content was removed from the DOM, it did not show up again within the dialog. To fix this I simply added an option to the simpledailog2 method called 'removeOnClose' that allows people to keep their dialog content in the DOM after the close button is clicked. The default value is true, which will keep the default behavior of removing the content. This option has to be set to false in order to just hide the content.

I still need the hidden elements in the DOM, so changing all the remove() methods to hide()
Instead of changing the remove methods, just added a new option for hiding the dialog content instead of removing it from DOM. By default, content will be removed, unless the option is set to false.
Took out the logging used while testing.
Added a new option 'removeOnClose' which is true by default and has the default bahavior. However, if set to false, the content of the dialog will be hidden instead of removing from the DOM.
@DemitryT DemitryT closed this Feb 13, 2013
@DemitryT DemitryT reopened this Feb 13, 2013
@DemitryT
Copy link
Author

too many commits for one change, will open a new one.

@DemitryT DemitryT closed this Jun 11, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant