PageSourceSearch

https://app.wpml.org/assets/controllers/highlight_fade_controller-7d59cbb0.js

js wpml.org collected 2026-10-01 06:58:43 UTC 1,113 bytes, 24 lines download raw bytes

1import { Controller } from "@hotwired/stimulus"
2
3// Auto-fades the one-time "just regenerated" row highlight (bg-green-50) in
4// accounts/payments.html.erb after a delay, instead of leaving it until the next full page
5// reload/navigation (Müge: "remove the green highlight after some delay" — it currently stays
6// there still after editing is done). Only mounted on rows that actually have the highlight
7// (see the `if highlighted` guard at the call site), so there's no timer running for the common
8// case of an unhighlighted row.
9export default class extends Controller {
10  static values = { delay: { type: Number, default: 3000 } }
11
12  connect() {
13    this.timeout = setTimeout(() => {
14      // Transition first, then drop the color on the next frame so the removal actually
15      // animates instead of cutting instantly (same order as toast_controller.js's dismiss()).
16      this.element.classList.add("transition-colors", "duration-700")
17      requestAnimationFrame(() => this.element.classList.remove("bg-green-50"))
18    }, this.delayValue)
19  }
20
21  disconnect() {
22    clearTimeout(this.timeout)
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.