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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.