From d23fa35e4293d48b54e2193bba16e1ffb9ac94b8 Mon Sep 17 00:00:00 2001 From: zino Date: Wed, 24 Mar 2021 21:48:23 +0100 Subject: [PATCH] fixed multiple close/open dialog --- client/src/inject.ts | 5 ++--- client/src/modules/config.ts | 3 ++- client/src/modules/ui.ts | 5 +++-- client/src/types/types.d.ts | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/inject.ts b/client/src/inject.ts index 06c25d7..ef0609f 100644 --- a/client/src/inject.ts +++ b/client/src/inject.ts @@ -8,7 +8,6 @@ import * as UI from "./modules/ui"; import { config } from "./modules/config"; let inputsWithValue: I.InputsWithValue; -let childHasVenueXML: boolean = false; function messagesHandler(e: any) { if (typeof (e.data) !== 'string') @@ -31,7 +30,7 @@ function messagesHandler(e: any) { } case "child_init_needVenueXML": { Communication.sendXML(inputsWithValue["posturl"], "iframeSeatmap", "parent_init_sendVenueXML", "parent"); - childHasVenueXML = true; + config.childHasVenueXML = true; break; } case "child_needSeatmapXML": { @@ -71,7 +70,7 @@ window.addEventListener('load', function () { inputsWithValue = { ...inputsWithValue, ...importantNote }; UI.injectBookingBtn(); - UI.createDialog(childHasVenueXML); + UI.createDialog(); console.log(inputsWithValue); diff --git a/client/src/modules/config.ts b/client/src/modules/config.ts index 6be3212..5d4ee6a 100644 --- a/client/src/modules/config.ts +++ b/client/src/modules/config.ts @@ -12,5 +12,6 @@ export const config: I.Config = { urlJSCStaging: "https://staging.tickets.zinomedia.de/libs/jQuery-Seat-Charts/jquery.seat-charts.min.js", urlJSCMaster: "https://tickets.zinomedia.de/libs/jQuery-Seat-Charts/jquery.seat-charts.min.js", urlCSSJSCStaging: "https://staging.tickets.zinomedia.de/libs/jQuery-Seat-Charts/jquery.seat-charts.css", - urlCSSJSCMaster: "https://tickets.zinomedia.de/libs/jQuery-Seat-Charts/jquery.seat-charts.css" + urlCSSJSCMaster: "https://tickets.zinomedia.de/libs/jQuery-Seat-Charts/jquery.seat-charts.css", + childHasVenueXML: false } \ No newline at end of file diff --git a/client/src/modules/ui.ts b/client/src/modules/ui.ts index 56bf968..d68e5b6 100644 --- a/client/src/modules/ui.ts +++ b/client/src/modules/ui.ts @@ -2,6 +2,7 @@ import * as I from "../types/types"; import * as Communication from "./communication"; import Panzoom from '@panzoom/panzoom'; import { PanzoomObject } from "@panzoom/panzoom/dist/src/types"; +import { config } from "./config"; export function setOptionSelect(inSeatmapListing: I.Seatmap[], inId: string) { const seatmapDropdown: HTMLElement | null = document.getElementById(inId); @@ -23,7 +24,7 @@ export function setEventInfo(inEventInfo: I.EventInfo, inInputswithValue: I.Inpu jQuery("#eventInfoLocation p")[0].childNodes[0].textContent = inInputswithValue.venueLocation; } -export function createDialog(inChildHasVenueXML: boolean): void { +export function createDialog(): void { jQuery("#dialogSeatmap").append($("