Add force refresh#12
Conversation
This will allow users to define if they want to refresh the window should it still exist. This requires them to pass a name for that window, and toggle force refresh off. Since they don't want to refresh it will simply bring it in focus
|
Could this be expedited if I added it to the sample page? |
Without this patch the popup will always refresh. This will allow users to just bring focus to a window.
|
There I added a sample. Please visit this repo and download it and view the example.html. The The To test:
You will see the one with Without this patch both pages would refresh back to google.com, and the user would have lost any work they had completed. |
|
@mkdynamic Have you had a chance to look at this feature at all? Im about to implement this on another project and would like to pull from your main branch instead of having a custom build. I prefer this over the alt version, as this is better at maintaining the window handles. |
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
forcerefreshto 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
forcerefreshdisabled 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
forcerefreshoff.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:falsethe 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.