iframe-coordinator-cli 5.3.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/views/IframeEmbed.vue +13 -0
package/package.json
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
v-on:notifyRequest="displayToast"
|
|
40
40
|
v-on:registeredKeyFired="handleKeyEvent"
|
|
41
41
|
v-on:navRequest="handleNav"
|
|
42
|
+
v-on:promptOnLeave="handlePromptOnLeave"
|
|
42
43
|
v-on:frameTransition="updateFrameUrl"
|
|
43
44
|
v-on:pageMetadata="updatePageMetadata"
|
|
44
45
|
></frame-router>
|
|
@@ -109,6 +110,18 @@ export default {
|
|
|
109
110
|
this.metadata = {
|
|
110
111
|
title: event.detail.title,
|
|
111
112
|
breadcrumbs: event.detail.breadcrumbs
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
handlePromptOnLeave(event) {
|
|
116
|
+
if (event.detail.shouldPrompt === true) {
|
|
117
|
+
window.onbeforeunload = function(event) {
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
//This is needed for compatibility with Google Chrome.
|
|
120
|
+
event.returnValue = '';
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (event.detail.shouldPrompt === false) {
|
|
124
|
+
window.onbeforeunload = null;
|
|
112
125
|
}
|
|
113
126
|
}
|
|
114
127
|
},
|