From 2572e99b95f1725e2ba40e796e5e72646f9ef603 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sun, 21 Feb 2021 01:57:50 +0100 Subject: [PATCH] Add tests in iframe, fix loading in iframes --- InitUiElements.ts | 5 ++--- test.html | 2 ++ test.ts | 14 -------------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/InitUiElements.ts b/InitUiElements.ts index 3ae6fa0..6ced925 100644 --- a/InitUiElements.ts +++ b/InitUiElements.ts @@ -123,9 +123,8 @@ export class InitUiElements { if ((window != window.top && !State.state.featureSwitchWelcomeMessage.data) || State.state.featureSwitchIframe.data) { const currentLocation = State.state.locationControl; const url = `${window.location.origin}${window.location.pathname}?z=${currentLocation.data.zoom}&lat=${currentLocation.data.lat}&lon=${currentLocation.data.lon}`; - const content = new Link(Svg.pop_out_ui().SetClass("iframe-escape"), url, true); - new FixedUiElement(content.Render()).AttachTo("help-button-mobile") - content.AttachTo("messagesbox"); + new Link(Svg.pop_out_ui().SetClass("iframe-escape"), url, true) + .AttachTo("messagesbox"); } State.state.osmConnection.userDetails.map((userDetails: UserDetails) => userDetails?.home) diff --git a/test.html b/test.html index 62745b9..f2975d0 100644 --- a/test.html +++ b/test.html @@ -18,5 +18,7 @@
'maindiv' not attached
'extradiv' not attached
+ + diff --git a/test.ts b/test.ts index 2c32da8..8b13789 100644 --- a/test.ts +++ b/test.ts @@ -1,15 +1 @@ -//* - -import {ImageCarousel} from "./UI/Image/ImageCarousel"; -import {UIEventSource} from "./Logic/UIEventSource"; - -const images = new UIEventSource<{ url: string, key: string }[]>( - [{url: "https://2.bp.blogspot.com/-fQiZkz9Zlzg/T_xe2X2Ia3I/AAAAAAAAA0Q/VPS8Mb8xtIQ/s1600/cat+15.jpg", key: "image:1"}, - { - url: "https://www.mapillary.com/map/im/VEOhKqPcJMuT4F2olz_wHQ", - key: "mapillary" - }, - {url: "https://i.imgur.com/mWlghx0.jpg", key: "image:1"}]) -new ImageCarousel(images, new UIEventSource({"image:1":"https://2.bp.blogspot.com/-fQiZkz9Zlzg/T_xe2X2Ia3I/AAAAAAAAA0Q/VPS8Mb8xtIQ/s1600/cat+15.jpg"})) - .AttachTo("maindiv")