mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-02 03:09:44 -06:00
24 lines
624 B
JavaScript
24 lines
624 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
export default class extends Controller {
|
|
static values = {
|
|
selfHosted: Boolean
|
|
}
|
|
|
|
// Every controller that extends BaseController and uses initialize()
|
|
// should call super.initialize()
|
|
// Example:
|
|
// export default class extends BaseController {
|
|
// initialize() {
|
|
// super.initialize()
|
|
// }
|
|
// }
|
|
initialize() {
|
|
// Get the self-hosted value from the HTML root element
|
|
if (!this.hasSelfHostedValue) {
|
|
const selfHosted = document.documentElement.dataset.selfHosted === 'true'
|
|
this.selfHostedValue = selfHosted
|
|
}
|
|
}
|
|
}
|