1import { Controller } from "@hotwired/stimulus" 2import Cookies from 'js-cookie' 3 4export default class extends Controller { 5 6 static values = { id: String } 7 8 connect() { 9 if (Cookies.get(this.cookieKey)) { 10 this.element.setAttribute("hidden", true); 11 } 12 } 13 14 dismiss(e) { 15 e.preventDefault(); 16 Cookies.set(this.cookieKey, true); 17 this.element.setAttribute("hidden", true); 18 } 19 20 get cookieKey() { 21 // WARNING: Changing this will invalidate existing cookies 22 return "dismissible_dismissed_" + this.idValue; 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.