1import { Controller } from "@hotwired/stimulus" 2 3// The map's get/shed switch. 4// 5// Unlike the category pills, this reloads: "getting stuff" and "getting rid of stuff" 6// are two different sets of places, filtered in SQL, not two views of one set. Putting 7// the mode in the URL also means a link to one side of the map stays on that side. 8// 9// Listens on the wrapper rather than on each segment, so SegmentedControlComponent 10// keeps rendering plain buttons. 11export default class extends Controller { 12 switch(event) { 13 const button = event.target.closest("button[value]") 14 if (!button) return 15 16 const url = new URL(window.location.href) 17 url.searchParams.set("mode", button.value) 18 Turbo.visit(url.toString()) 19 } 20}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.