added iframe support
This commit is contained in:
1 parent
c8ea35c7f8
commit
0e51144845
2 files changed
+20
-4
No files matched your search
@@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="uk-height-large uk-flex uk-flex-center uk-flex-middle uk-background-cover uk-light"
|
<div class="uk-height-large uk-flex uk-flex-center uk-flex-middle uk-background-cover uk-light"
|
||||||
style="background-color: black"
|
style=""
|
||||||
id="leaflet-map"
|
id="leaflet-map"
|
||||||
data-city="@Model.City">
|
data-city="@Model.City">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
// Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
|
||||||
// for details on configuring this project to bundle and minify static web assets.
|
const state ={height: -1, url: ''};
|
||||||
|
|
||||||
// Write your JavaScript code.
|
function urlWithoutOrigin(url){
|
||||||
|
return url.replace(new URL(url).origin, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendEvent(){
|
||||||
|
const height = document.documentElement.offsetHeight;
|
||||||
|
const url = urlWithoutOrigin(document.URL);
|
||||||
|
if(height === state.height && url === state.url){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
state.height = height;
|
||||||
|
state.url = url;
|
||||||
|
const event = {... state};
|
||||||
|
window.parent.postMessage(event, "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
window.setInterval(sendEvent, 100)
|
||||||
Reference in new issue
Block a user