minad / olelo

Wiki with git backend
MIT License
241 stars 44 forks source link

Unsaved changes javascript check not working properly in Internet Explorer #42

Closed minad closed 13 years ago

minad commented 13 years ago

Clicking on save shows popup

imrehg commented 13 years ago

I think it is more complicated than that, the popup behaviour needs to be rethought a bit (i tried but haven't got too far yet :/ )

E.g. no popup needed if one presses any of

but there should be a pop-up for Reset.

Also, after the first click, there is no more pup-up if one leaves the page even if there are unsaved changes. I.e. if I change the page, press preview (popup show) and then leave page (no popup) my changes were thrown away.

Probably connected to this one, Reset only resets to the latest page view (so after the pressing Preview, Reset goes back to that state instead of the last saved version) - though I'd say this could be a "quirk" instead of a bug, depending on expectated behaviour.

minad commented 13 years ago

You are right there are some improvements necessary. Preview and changes should be solved via ajax maybe. Then the problem with reset would go away.

The problem with the "quit page" dialog if you click the save button exists only in chrome and IE. The javascript onbeforeunload handler is called before the submit handler of the form (onsubmit). Therefore it seems to be impossible to distinguish between leaving the page/submitting the form.

minad commented 13 years ago

fixed in 0d3aeef757a0144a06060f6ab92554353b120dbf