fixed multiple close/open dialog
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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($("<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/"))
|
||||
.dialog({
|
||||
@@ -43,7 +44,7 @@ export function createDialog(inChildHasVenueXML: boolean): void {
|
||||
});
|
||||
|
||||
jQuery("#openSeatmap").on("click", () => {
|
||||
if (!inChildHasVenueXML)
|
||||
if (!config.childHasVenueXML)
|
||||
Communication.sendEventToChild("parent_init_venue");
|
||||
|
||||
jQuery('html, body').css('overflow', 'hidden');
|
||||
|
||||
1
client/src/types/types.d.ts
vendored
1
client/src/types/types.d.ts
vendored
@@ -57,6 +57,7 @@ export interface Config {
|
||||
urlCSSJSCMaster: string;
|
||||
urlCSSParentStaging: string;
|
||||
urlCSSParentMaster: string;
|
||||
childHasVenueXML: boolean;
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
|
||||
Reference in New Issue
Block a user