summaryrefslogtreecommitdiff
path: root/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/app.js')
-rw-r--r--js/app.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/app.js b/js/app.js
index 0d91c84..5898f5c 100644
--- a/js/app.js
+++ b/js/app.js
@@ -82,7 +82,15 @@ function bind () {
})
window.onbeforeunload = function() {
- if (changed) return "You have edited this drawing."
+ if (changed && !in_iframe()) return "You have edited this drawing."
+ }
+
+ function in_iframe () {
+ try {
+ return window.self !== window.top;
+ } catch (e) {
+ return true;
+ }
}
}