Sha256: 64cfc2a2d3392bc8747a6f7b16ff2b45a2bca295d728a31b4e09219b7cfd1913
Contents?: true
Size: 517 Bytes
Versions: 45
Compression:
Stored size: 517 Bytes
Contents
import { Controller } from "@hotwired/stimulus"; export default class StatusBarController extends Controller { connect() { // cache the version's state in the controller on connect this.versionState = this.element.dataset.state; } change(e) { if (e.detail && e.detail.hasOwnProperty("dirty")) { this.update(e.detail); } } update({ dirty }) { if (dirty) { this.element.dataset.state = "dirty"; } else { this.element.dataset.state = this.versionState; } } }
Version data entries
45 entries across 45 versions & 2 rubygems