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.
Hey Eric,
I added a number of features to simple modal as it wasn't covering all edge cases I needed for a project. The main functionality I improved upon was calculations in getDimensions(), which now allows for better resizing based on the nested document contents. It does bounds checking on the viewport to ensure the container does not exceed the window size.
I also went ahead and added animation handling to autoResize() so the container now expands and contracts on either update() or when the $(document).resize() fires.
The last thing, and I'm not so sure what I may have broken, was that the setTimeout() of 10 ms on close causes problems when trying to perform a number of consecutive calls to$.modal.close() followed by $ .modal.X. Either way, take a look at the code and feel free to merge it once fully tested. I'm sure there are still a few edge cases considering the amount of dimension calculations I modified, but it seems to be working pretty well.
Corey