Aurigma Forums
»
Customer's Canvas
»
Discussions – Customer's Canvas
»
How can I know if there is any pending change in current canvas editor?
Rank: Member
Groups: Administration
Joined: 10/19/2015(UTC) Posts: 21
Thanks: 11 times
|
Hi, I am implementing a jquery browser closing event for protecting unsaved canvas template design. I am using Iframe api for editor.saveProduct(). If the user makes some design changes and if he attempts to close the browser tab without saving, I need to show a message. How can I do that? Edited by user Friday, January 15, 2016 3:13:20 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Administration
Joined: 10/20/2015(UTC) Posts: 52
Was thanked: 14 time(s) in 13 post(s)
|
Hi You need to use the onbeforeunload jQuery function: Code:
window.onbeforeunload = confirmExit;
function confirmExit(evt){
var message = "You design is not saved. You will lost the changes if you leave the page."
if (evt) {evt.returnValue = message;}
return message;
}
Your user will see the following window: If user clicks the "Leave" button, the page will be closed and a design doesn't save. If user clicks the "Stay" button, you need to call the saveProduct() method; Best regards, Kate.
|
|
|
|
Aurigma Forums
»
Customer's Canvas
»
Discussions – Customer's Canvas
»
How can I know if there is any pending change in current canvas editor?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.