implemented check tick selected seat
This commit is contained in:
@@ -1,6 +1,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";
|
||||
|
||||
export function setOptionSelect(inSeatmapListing: I.Seatmap[], inId: string) {
|
||||
const seatmapDropdown: HTMLElement | null = document.getElementById(inId);
|
||||
@@ -72,10 +73,35 @@ export function injectBookingBtn(): void {
|
||||
`);
|
||||
}
|
||||
|
||||
export function destroyCurrentSeatmap(): void {
|
||||
export function convertLegendToDropdown(inID: string) {
|
||||
jQuery('ul.seatCharts-legendList').each(function() {
|
||||
let select = jQuery(document.createElement('select')).insertBefore(jQuery(this).hide());
|
||||
select.attr({ id: inID});
|
||||
let option = jQuery('<option/>');
|
||||
option.attr({ 'value': 'all' }).text('Alle Preiskategorien');
|
||||
option.css("color", "#5c5c5c");
|
||||
select.append(option);
|
||||
jQuery('>li', this).each(function() {
|
||||
const className = jQuery(this)[0].children[0].classList[3];
|
||||
const val = className.substring(1);
|
||||
const text = (<HTMLElement>jQuery(this)[0].children[1]).innerText;
|
||||
let option = jQuery('<option/>');
|
||||
|
||||
option.attr({ 'value': val, 'class': className }).text(text);
|
||||
select.append(option);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function destroyCurrentSeatmap(inSelector: string, inPanzoom: PanzoomObject | undefined): void {
|
||||
if (inPanzoom)
|
||||
unbindPanzoomEvents(inSelector, inPanzoom);
|
||||
|
||||
jQuery("#containerSeatmapInner").remove();
|
||||
jQuery("#htmlSeatmapInner .fl-html").removeAttr("style");
|
||||
jQuery("#htmlSeatmapInner .fl-html").append('<div id="containerSeatmapInner"></div>');
|
||||
jQuery("#JSCLegendInner").remove();
|
||||
jQuery("#JSCLegend .fl-html").append('<div id="JSCLegendInner"></div>');
|
||||
}
|
||||
|
||||
export function controlLoftloader(inSwitch: string) {
|
||||
@@ -85,10 +111,16 @@ export function controlLoftloader(inSwitch: string) {
|
||||
jQuery("body").addClass("loaded loftloader-loaded");
|
||||
}
|
||||
|
||||
export function addPanzoom(inSelector: string, inBtnZoomIn: string | null = null, inBtnZoomOut: string | null = null, inBtnResetZoom: string | null = null) {
|
||||
function unbindPanzoomEvents(inSelector: string, inPanzoom: PanzoomObject): void {
|
||||
console.log("unbinding now");
|
||||
const container: HTMLElement = jQuery(inSelector).get(0);
|
||||
container.parentElement?.removeEventListener('wheel', inPanzoom.zoomWithWheel);
|
||||
}
|
||||
|
||||
export function addPanzoom(inSelector: string, inBtnZoomIn: string | null = null, inBtnZoomOut: string | null = null, inBtnResetZoom: string | null = null): PanzoomObject | undefined {
|
||||
const container: HTMLElement = jQuery(inSelector).get(0);
|
||||
if (container) {
|
||||
const panzoom = Panzoom(container, {
|
||||
const panzoom: PanzoomObject = Panzoom(container, {
|
||||
maxScale: 5,
|
||||
animate: false,
|
||||
overflow: "hidden",
|
||||
@@ -114,5 +146,13 @@ export function addPanzoom(inSelector: string, inBtnZoomIn: string | null = null
|
||||
btnResetZoom.addEventListener('click', panzoom.reset);
|
||||
}
|
||||
|
||||
return panzoom;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function changeVenueImage(inInputsWithValue: I.InputsWithValue) {
|
||||
if (inInputsWithValue.venueImageSrc !== undefined)
|
||||
jQuery("#venueImage img").attr("src", inInputsWithValue.venueImageSrc);
|
||||
}
|
||||
Reference in New Issue
Block a user