1import { Controller } from "@hotwired/stimulus" 2 3export default class extends Controller { 4 static targets = ["submit", "loader", "modal"] 5 6 formTarget = this.submitTarget.closest('form'); 7 8 swapForLoader(event) { 9 event.preventDefault(); 10 // this.submitTarget.classList.add('hidden'); 11 // this.loaderTarget.classList.remove('hidden'); 12 13 if (this.element.dataset.foodConfirm == 'true') { 14 const itemsElement = document.querySelector('select[data-controller="tom-select"]#recipe_feature_ingredients').nextElementSibling.querySelector('.ts-control'); 15 const numItems = itemsElement.querySelectorAll('.item').length; 16 17 if (numItems == 0) { 18 this.modalTarget.classList.remove('hidden'); 19 } else { 20 // setTimeout(() => { 21 const form = this.submitTarget.closest('form'); 22 form.submit(); 23 // }, 1500); 24 } 25 } else { 26 // setTimeout(() => { 27 this.formTarget.submit(); 28 // }, 1500); 29 } 30 } 31 32 proceed() { 33 this.modalTarget.classList.add('hidden'); 34 this.formTarget.submit(); 35 } 36 37 cancel() { 38 this.modalTarget.classList.add('hidden'); 39 // this.submitTarget.classList.remove('hidden'); 40 // this.loaderTarget.classList.add('hidden'); 41 } 42};
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.