Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add force refresh #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add force refresh #12

wants to merge 3 commits into from

Conversation

thorst
Copy link
Collaborator

@thorst thorst commented Apr 21, 2014

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 should
be 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 focus
without 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 same
ticket 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.

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
@thorst
Copy link
Collaborator Author

thorst commented Apr 25, 2014

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.
@thorst
Copy link
Collaborator Author

thorst commented Apr 25, 2014

There I added a sample. Please visit this repo and download it and view the example.html.

The Open window (named with refresh) link simulated the existing behavior.

The Open window (named without refresh) demonstrates what the patch offers.

To test:

  • Click the last two links
  • Type "test" into google search box in both pop ups
  • Click last two links again

You will see the one with forcerefresh disabled your page will still have the google search results. The other will be back to google.com.

Without this patch both pages would refresh back to google.com, and the user would have lost any work they had completed.

@thorst
Copy link
Collaborator Author

thorst commented Jul 8, 2014

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant