Open Bug 373117 Opened 17 years ago Updated 16 years ago

Make attachment-details form work with firefox 'reopen closed tab' feature

Categories

(Bugzilla :: Attachments & Requests, defect)

defect
Not set
normal

Tracking

()

People

(Reporter: sicking, Unassigned)

Details

Steps to reproduce:

1. Open the attachment details page for a patch
2. Press 'Edit attachment as Comment'
3. Make comments on patch
4. Close tab  (this step is accidental on the users (i.e. my) part)
5. Use the 'Recently closed tabs' feature to reopen the page

Expected results:
Would be great to see the page as it was with my patch comments still there

Actual results:
The page is shown in its initial state. Pressing 'Edit attachment as Comment' displays the original value and not my comments.


I suspect the same thing happen if you in step 4 instead navigate far enough away from the page that the bfcache no longer holds the original page.


To fix this you could store whatever state is needed to be saved in form controls. The values of form controls are restored when a tab is 'reopened', however the DOM and javascript state is not.

Looking at the js code it looks like the values 'current_mode' and 'prev_mode' would need to be stored in a hidden textfield. The comments in the textarea are most likely already restored.
This would probably also make IE be able to deal with leaving the attachment page and then going 'back' to it since it also restores form controls values. Though iirc the timing on when the values are restored is slightly different.
Isn't it a dupe of bug 387607?
Not quite the same. That bug changes it such that the date isn't lost if you click the button. This bug requested that the viewable state be persisted the same way the data is, so that the page is put back into it's original state without having to click the button again (which also makes it more obvious that your data wasn't lost).
You need to log in before you can comment on or make changes to this bug.