Add bridge page controller and helpers.

This commit is contained in:
Denis Švara
2026-01-06 15:54:10 +01:00
parent b84da94016
commit 177afe1a41
5 changed files with 164 additions and 2 deletions
@@ -0,0 +1,13 @@
import { BridgeElement } from "@hotwired/hotwire-native-bridge"
BridgeElement.prototype.isDisplayedOnPlatform = function() {
return !this.hasClass("hide-on-native")
}
BridgeElement.prototype.showOnPlatform = function() {
this.element.classList.remove("hide-on-native")
}
BridgeElement.prototype.hideOnPlatform = function() {
this.element.classList.add("hide-on-native")
}
+1 -1
View File
@@ -1 +1 @@
// Bridge initializers live here.
import "bridge/initializers/bridge_element"