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

Prompt before exiting tab with unsaved changes #815

Merged
merged 1 commit into from
Nov 15, 2017

Conversation

Benaiah
Copy link
Contributor

@Benaiah Benaiah commented Nov 13, 2017

- Summary

Prompts before closing the entry page if there are unsaved changes present. Closes #286.

- Test plan

Tested manually.

- Description for the changelog

Prompt before exiting tab with unsaved changes

}

const unblock = history.block(this.blocker);
window.onbeforeunload = window.onbeforeunload || this.blocker;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wonder if using addEventListener and removeEventListener would be better here.

Copy link
Contributor

@tech4him1 tech4him1 Nov 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

window.addEventListener("beforeunload", this.blocker) and window.removeEventListener("beforeunload", this.blocker)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Benaiah Benaiah force-pushed the prompt-before-closing-entry-page branch from 03ded66 to ba78589 Compare November 13, 2017 19:03
@Benaiah Benaiah force-pushed the prompt-before-closing-entry-page branch from ba78589 to 8b56849 Compare November 13, 2017 19:10
Copy link
Contributor

@tech4him1 tech4him1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erquhart erquhart merged commit aa813e8 into master Nov 15, 2017
@erquhart erquhart deleted the prompt-before-closing-entry-page branch November 15, 2017 17:44
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.

3 participants