select-your-own-seat

Expand History Expand History
Collapse History Collapse History

Add panning and zooming to SVG map element

This commit adds a dependency on the svg-pan-zoom package.

To manage the configuration and execution of that plugin, this commit introduces controllers/seats_controller JavaScript module. That module will be instantiated with elements that declare data-controller="seats".

Once an element with data-controller="seats" exists on the page, the module’s connect() life cycle hook will be invoked, which will initiate the svgPanZoom plugin configuration, passing a reference to this.element as the DOM Node to attach the map to.

Additionally, This commit wraps the collection of <use> elements in an outer <g> element (as suggested by aritutta/svg-pan-zoom#146).

Desktop

panning-zooming-click