If instead of clicking Save, the user clicks Preview, and then navigates away from that, the work is (potentially) lost.

Steps:
1. Log in
2. Add content
3. Choose a content type, e.g., Basic Page
4. Type in all required fields
5. Click Preview
6. Click Home button

Actual results: Navigates away from page without warning.
Expected results: Gives navigation warning. That is, preview is assumed dirty.

(In this instance, I was able to use the back button and retained my work, but had step 6 been Click Log out, the work would have been lost.)

Comments

Charles Belov’s picture

Issue summary: View changes
Charles Belov’s picture

I added the following lines to add preview protection:

        if (document.getElementsByClassName('node-preview').length > 0) {
          edit = true;
        }

before

if ((edit) && !click) {

If I have a chance, I'll submit it as a patch.

Mohammed J. Razem’s picture

Status: Active » Closed (outdated)

Closing this as outdated as this version will no longer be supported/maintained.