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.
To allow users to bring focus to an existing popup without causing the window to refresh.
Current behavior:
Clicking on a link to open a pop up that happens to already exist will cause that window
to refresh. This has the potential for users to lose unsaved work, or lose the current
URL if it was different from the initial one they were presented with.
I chose the name
forcerefresh
to define this current behavior. In my opinion this shouldbe defaulted to false, but in order to maintain backwards compatibility I set it to true.
With
forcerefresh
disabled it will allow users to just have the pop up brought into focuswithout the refresh if it exists. If it doesn't exist, the pop up will be created and given
focus.
In order to use this feature to work the user needs to pass a name for that window, and toggle
forcerefresh
off.An example of use:
With a help desk system, users may need to be working on multiple tickets simultaneously.
With this requirement a modal is out of the question. If a user clicks on a ticket link in the
main window a pop up is displayed, which will allow users to modify its contents. Using
forcerefresh:false
the developer can ensure that when the user clicks on that sameticket link they will be presented with the existing pop up but without losing any modifications
they have completed, but not saved.
An alternative:
I've create an alternative in #13. Check that out and determine which you would like to inlcude.