PageSourceSearch

https://bulkbooks.com/assets/controllers/sector_tabs_controller-91…9c36fa72991ff64604d8130f1ca08b813381a13b.js

js bulkbooks.com collected 2026-09-24 10:32:08 UTC 860 bytes, 24 lines download raw bytes

1import { Controller } from "@hotwired/stimulus"
2
3// Homepage sector tabs (Educators / Businesses / Churches...) — ported from the
4// old site's Bootstrap tab behavior. One click switches both the description
5// pane and the matching incentives pane.
6//
7//   <section data-controller="sector-tabs">
8//     <a data-action="click->sector-tabs#show" data-sector-tabs-key-param="education">
9//     <div data-sector-tabs-target="pane" data-key="education">
10//   </section>
11export default class extends Controller {
12  static targets = ["pane", "tab"]
13
14  show(event) {
15    event.preventDefault()
16    const key = event.params.key
17    this.paneTargets.forEach((pane) => {
18      pane.classList.toggle("hidden", pane.dataset.key !== key)
19    })
20    this.tabTargets.forEach((tab) => {
21      tab.classList.toggle("bb-sector-active", tab.dataset.key === key)
22    })
23  }
24};

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.