-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add panning and zooming to SVG map element
This commit adds a dependency on the [`svg-pan-zoom` package][svg-pan-zoom]. The plus and minus buttons introduced in the previous commit are decorated with `data-action` declarations which route `click` events to the `seats#zoomIn` and `seats#zoomOut` actions, respectively. When navigating to other floors (i.e. navigations that trigger `seats#discardMap`), [destroy the `svg-pan-zoom` provided instance] during Stimulus' [`disconnect` lifecycle method][disconnect], which is invoked during Turbolinks-initiated page visits, even for elements annotated with `data-turbolinks-permanent`. This commit wraps the collection of `<use>` elements in an outer [`<g>` element][g-element] (as suggested by [aritutta/svg-pan-zoom#146]). [svg-pan-zoom]: https://github.com/ariutta/svg-pan-zoom/tree/3.6.0 [g-element]: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g [aritutta/svg-pan-zoom#146]: bumbu/svg-pan-zoom#146 [destroy]: https://github.com/ariutta/svg-pan-zoom/tree/3.6.0#public-api [disconnect]: https://stimulusjs.org/reference/lifecycle-callbacks#disconnection
- Loading branch information
1 parent
ae71db5
commit f40540c
Showing
4 changed files
with
59 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters