1import { Controller } from "@hotwired/stimulus" 2 3// Connects to data-controller="add-tracking-multiple-rentals" 4export default class extends Controller { 5 static targets = ['firstModal', 'secondModal', 'checkboxes', 'noRentalSelectedError']; 6 7 connect = () => { 8 this.modalId = this.firstModalTarget.dataset.modalId 9 $(`#${this.modalId}`).on('hidden.bs.modal', this.modalClosed); 10 } 11 12 continueToNextModal = () => { 13 const isSelected = this.checkboxesTargets.some(checkbox => checkbox.checked); 14 15 if (isSelected) { 16 this.firstModalTarget.classList.add('d-none'); 17 this.noRentalSelectedErrorTarget.classList.add('d-none'); 18 this.secondModalTarget.classList.remove('d-none'); 19 } else { 20 this.noRentalSelectedErrorTarget.classList.remove('d-none'); 21 } 22 } 23 24 modalClosed = () => { 25 this.firstModalTarget.classList.remove('d-none'); 26 this.secondModalTarget.classList.add('d-none'); 27 this.noRentalSelectedErrorTarget.classList.add('d-none'); 28 this.checkboxesTargets.forEach((checkbox) => { 29 checkbox.checked = false; 30 }); 31 } 32};
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.