1import {Controller} from '@hotwired/stimulus'; 2 3/** 4 * Popin invitant les utilisateurs non connectés à se connecter pour sauvegarder 5 * une recherche / consulter leur historique. 6 * 7 * Reprend le bloc « Handle the save search button when user is not logged in ». 8 */ 9/* stimulusFetch: 'lazy' */ 10export default class extends Controller { 11 static targets = ['prompt']; 12 13 connect() { 14 this.container = document.querySelector('body > .container'); 15 } 16 17 open(event) { 18 event.preventDefault(); 19 if (!this.hasPromptTarget) return; 20 21 this.promptTarget.classList.add('open'); 22 this.container?.classList.add('z-index-adjusted'); 23 } 24 25 close(event) { 26 event.preventDefault(); 27 if (!this.hasPromptTarget) return; 28 29 this.promptTarget.classList.remove('open'); 30 setTimeout(() => this.container?.classList.remove('z-index-adjusted'), 500); 31 } 32 33 // action : click->search--login-prompt#clearQueryString (sur .btn-validate) 34 clearQueryString() { 35 window.history.pushState({}, document.title, window.location.pathname); 36 } 37}
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.