-
Notifications
You must be signed in to change notification settings - Fork 42
New Feature: Forcerefresh #7
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
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. if they dont want to refresh it will simply bring it in focus
I tried using localstorage api, but you cannot store the object and retrieve it. Maybe IndexedDB would work, but this hack works just as well at grabbing a refrence, even if the parent page was refreshed.
I think its smarter to check if its not undefined. I dont know if its standard to be `about:blank`
Im still working on this. Ill let you know when its done. |
I think its right now. Sorry about the delay. |
Thanks for the pull request! I don't think I understand this feature or where someone might want to use it. Can you give me an example scenario? I haven't looked at the code yet, but it would be easier to review if you squished some of these commits. It is good to be atomic, but it isn't helpful in a pull request to have a commit that makes a change followed by a few commits that fix problems in that change. Also, my comments regarding commit messages on another pull request of yours also applies here. |
Im writing a mini help desk. Originally i was using modals, but wanted to allow them to multi task. Using the current behavior, if they clicked a ticket, and started updating it, but never saved. Then they multi task and do something else, then they click on the ticket link again, it will refresh the popup and they will lose their work. With this code they can click the ticket link and just resume their work. They can even refresh the main window and still resume. In a sense i wouldn't need a global for handles but it makes the resolution quicker. Did that explain it? Sent from !MyComputer;
|
The reason i called it force refresh, was actually to give a name to the current behavior. Initially i wasn't planning on the persistent piece, but i had some time so i added it. At this point i guess i just wanted some feedback so that if you had any corrections i would fix it, and then do a proper pull request. Sent from !MyComputer;
|
I created #12 which hopefully fixes your concerns here. |
Proper pull request for a new feature called forcerefresh.
Current behavior:
if popup is still open it will refresh the window. If the user clicked a link and was taken to a different page, they will be taken back to the original page. Likewise, if the user has entered text on a form or performed some action that needed saved, they will lose any unsaved work.
With Forcerefresh:
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. if they dont want to refresh and it still exists it will simply bring it into focus