PageSourceSearch

https://www.hurrcollective.com/assets/controllers/brands/listing_c…436bfa197afaa1cdbc36a449816324317b7319ca.js

js hurrcollective.com collected 2026-09-24 20:37:56 UTC 884 bytes, 27 lines download raw bytes

1import { Controller } from '@hotwired/stimulus';
2import 'sortablejs';
3
4export default class extends Controller {
5  static targets = ['itemContainer', 'confirmReorderForm'];
6
7  activateReorderedListings(event) {
8    event.preventDefault();
9    event.currentTarget.classList.add('d-none');
10    this.confirmReorderFormTarget.classList.remove('d-none');
11    this.itemContainerTarget.classList.add('item-sortable');
12    this.sortableListings();
13  }
14
15  sortableListings() {
16    if (this.itemContainerTarget.classList.contains('item-sortable')) {
17      Sortable.create(this.itemContainerTarget, {
18        update: function (event, ui) {
19          let ids = $.map($(this).find('.brands-item-container'), (div) => {
20            return div.dataset.id + '=' + $(div).index();
21          });
22          document.getElementById('listing_ids').value = ids.join(',');
23        },
24      });
25    }
26  }
27};

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.