before state inputswithvalue
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import * as Communication from "./communication";
|
||||
import * as UI from "./ui";
|
||||
import { config } from "./config";
|
||||
import * as XMLHelper from "./xmlhelper";
|
||||
import * as I from "../types/types";
|
||||
import * as JSC from "./jsc";
|
||||
import * as Cart from "./cart";
|
||||
|
||||
export function addCloseModal() {
|
||||
const btnCloseModal: HTMLElement | undefined = jQuery("#btnCloseModal").get(0);
|
||||
@@ -17,3 +22,84 @@ export function addDropdownSeatmap(inPanzoom: any) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function addModalCart(inInputsWithValue: I.InputsWithValue) {
|
||||
const btnCart: HTMLElement | undefined = jQuery("#modalCart .uabb-button").get(0);
|
||||
if (btnCart) {
|
||||
btnCart.addEventListener("click", () => {
|
||||
if (!config.state.selectedSeatsArr.length)
|
||||
UI.showJBoxNotice(`Sie haben bislang keinen Platz ausgewählt.`);
|
||||
else if (config.state.cartChanged)
|
||||
XMLHelper.isValidSeatSelection(inInputsWithValue);
|
||||
else if (!config.state.cartChanged && config.state.isValidSeatSelection)
|
||||
UI.showModalCart();
|
||||
else if (!config.state.cartChanged && !config.state.isValidSeatSelection)
|
||||
UI.showJBoxNotice(`Auswahl nicht möglich: Bitte lassen Sie keinen einzelnen Platz frei.`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function addRedirectCheckout(inUrl: string | undefined) {
|
||||
if (!inUrl)
|
||||
return;
|
||||
|
||||
const btnCheckout = jQuery("#modalCart-overlay #checkout .fl-button").get(0);
|
||||
if (btnCheckout) {
|
||||
btnCheckout.addEventListener("click", function () {
|
||||
const message: I.Message = {
|
||||
message: {
|
||||
url: inUrl,
|
||||
},
|
||||
from: "child",
|
||||
event: "child_click_checkout",
|
||||
date: Date.now()
|
||||
};
|
||||
Communication.sendMessage(message, "parent");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function addCartClose() {
|
||||
const btnClose = jQuery("#modalCart-overlay .uabb-close-icon").get(0);
|
||||
if (btnClose) {
|
||||
btnClose.addEventListener("click", function () {
|
||||
Communication.sendEventToParent("child_show_dialog_titlebar");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function addCartBack() {
|
||||
const btnBack = jQuery("#modalCart-overlay #goBack .fl-button").get(0);
|
||||
if (btnBack) {
|
||||
btnBack.addEventListener("click", function () {
|
||||
jQuery("#modalCart-overlay .uabb-close-icon").trigger("click");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function dropdownLegendOnChange(inSelector: string, inSeatmap: any, inSeatmapXML: any) {
|
||||
const dropdownLegend = jQuery(inSelector).get(0);
|
||||
dropdownLegend.addEventListener("change", function (this: HTMLSelectElement) {
|
||||
const value: string = this.value;
|
||||
const className: string = `._${value}`;
|
||||
|
||||
UI.changeDropdownLegendBGColor(inSelector, value, className);
|
||||
|
||||
if (value === "all") {
|
||||
inSeatmap.find('unavailable').status('available');
|
||||
JSC.setUnavailableSeats(inSeatmapXML, inSeatmap);
|
||||
}
|
||||
else {
|
||||
inSeatmap.find('available').status('unavailable');
|
||||
JSC.activateSeatsBySectionID(inSeatmapXML, inSeatmap, value);
|
||||
JSC.setUnavailableSeats(inSeatmapXML, inSeatmap);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
export function addCartDropdownBuyerTypes(inSelector: string, inSeatObj: I.JSCSelectedSeat, inVenueXML: I.VenueXML, inInputsWithValue: I.InputsWithValue) {
|
||||
jQuery(inSelector).on('change', function (this: HTMLSelectElement) {
|
||||
Cart.changedDropdownBuyerType(this, inSeatObj, inVenueXML, inInputsWithValue);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user