fixed multiple close/open dialog

This commit is contained in:
zino
2021-03-24 21:48:23 +01:00
parent 04cf55e4fe
commit d23fa35e42
4 changed files with 8 additions and 6 deletions

View File

@@ -8,7 +8,6 @@ import * as UI from "./modules/ui";
import { config } from "./modules/config"; import { config } from "./modules/config";
let inputsWithValue: I.InputsWithValue; let inputsWithValue: I.InputsWithValue;
let childHasVenueXML: boolean = false;
function messagesHandler(e: any) { function messagesHandler(e: any) {
if (typeof (e.data) !== 'string') if (typeof (e.data) !== 'string')
@@ -31,7 +30,7 @@ function messagesHandler(e: any) {
} }
case "child_init_needVenueXML": { case "child_init_needVenueXML": {
Communication.sendXML(inputsWithValue["posturl"], "iframeSeatmap", "parent_init_sendVenueXML", "parent"); Communication.sendXML(inputsWithValue["posturl"], "iframeSeatmap", "parent_init_sendVenueXML", "parent");
childHasVenueXML = true; config.childHasVenueXML = true;
break; break;
} }
case "child_needSeatmapXML": { case "child_needSeatmapXML": {
@@ -71,7 +70,7 @@ window.addEventListener('load', function () {
inputsWithValue = { ...inputsWithValue, ...importantNote }; inputsWithValue = { ...inputsWithValue, ...importantNote };
UI.injectBookingBtn(); UI.injectBookingBtn();
UI.createDialog(childHasVenueXML); UI.createDialog();
console.log(inputsWithValue); console.log(inputsWithValue);

View File

@@ -12,5 +12,6 @@ export const config: I.Config = {
urlJSCStaging: "https://staging.tickets.zinomedia.de/libs/jQuery-Seat-Charts/jquery.seat-charts.min.js", 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", 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", 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
} }

View File

@@ -2,6 +2,7 @@ import * as I from "../types/types";
import * as Communication from "./communication"; import * as Communication from "./communication";
import Panzoom from '@panzoom/panzoom'; import Panzoom from '@panzoom/panzoom';
import { PanzoomObject } from "@panzoom/panzoom/dist/src/types"; import { PanzoomObject } from "@panzoom/panzoom/dist/src/types";
import { config } from "./config";
export function setOptionSelect(inSeatmapListing: I.Seatmap[], inId: string) { export function setOptionSelect(inSeatmapListing: I.Seatmap[], inId: string) {
const seatmapDropdown: HTMLElement | null = document.getElementById(inId); 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; jQuery("#eventInfoLocation p")[0].childNodes[0].textContent = inInputswithValue.venueLocation;
} }
export function createDialog(inChildHasVenueXML: boolean): void { export function createDialog(): void {
jQuery("#dialogSeatmap").append($("<iframe id='iframeSeatmap' scrolling='no' frameborder='0' marginwidth='0' marginheight='0' allowfullscreen width='100%' height='" + window.outerHeight + "px' />") jQuery("#dialogSeatmap").append($("<iframe id='iframeSeatmap' scrolling='no' frameborder='0' marginwidth='0' marginheight='0' allowfullscreen width='100%' height='" + window.outerHeight + "px' />")
.attr("src", "https://staging.tickets.zinomedia.de/")) .attr("src", "https://staging.tickets.zinomedia.de/"))
.dialog({ .dialog({
@@ -43,7 +44,7 @@ export function createDialog(inChildHasVenueXML: boolean): void {
}); });
jQuery("#openSeatmap").on("click", () => { jQuery("#openSeatmap").on("click", () => {
if (!inChildHasVenueXML) if (!config.childHasVenueXML)
Communication.sendEventToChild("parent_init_venue"); Communication.sendEventToChild("parent_init_venue");
jQuery('html, body').css('overflow', 'hidden'); jQuery('html, body').css('overflow', 'hidden');

View File

@@ -57,6 +57,7 @@ export interface Config {
urlCSSJSCMaster: string; urlCSSJSCMaster: string;
urlCSSParentStaging: string; urlCSSParentStaging: string;
urlCSSParentMaster: string; urlCSSParentMaster: string;
childHasVenueXML: boolean;
} }
export interface Message { export interface Message {