From 0483ae530286ee696d6f6e1df608670b521cd329 Mon Sep 17 00:00:00 2001 From: Adrien Maston Date: Tue, 10 Mar 2026 10:52:47 +0100 Subject: [PATCH] Add support for "bridge-slot" parameter --- app/javascript/initializers/bridge/bridge_element.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/javascript/initializers/bridge/bridge_element.js b/app/javascript/initializers/bridge/bridge_element.js index 438cf22e1..414f8ee30 100644 --- a/app/javascript/initializers/bridge/bridge_element.js +++ b/app/javascript/initializers/bridge/bridge_element.js @@ -5,7 +5,8 @@ BridgeElement.prototype.getButton = function() { title: this.title, icon: this.getIcon(), displayTitle: this.getDisplayTitle(), - displayAsPrimaryAction: this.getDisplayAsPrimaryAction() + displayAsPrimaryAction: this.getDisplayAsPrimaryAction(), + slot: this.getSlot() } } @@ -26,3 +27,7 @@ BridgeElement.prototype.getDisplayTitle = function() { BridgeElement.prototype.getDisplayAsPrimaryAction = function() { return !!this.bridgeAttribute(`display-as-primary-action`) } + +BridgeElement.prototype.getSlot = function () { + return this.bridgeAttribute("slot") ?? "right" +}