Merge pull request #2683 from basecamp/mobile/bridge-button-slot
Mobile / Bridge button slot
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="header__actions header__actions--end">
|
||||
<div>
|
||||
<%= link_to new_board_path, class: "btn btn--link btn--circle-mobile",
|
||||
data: { controller: "hotkey", action: "keydown.b@document->hotkey#click", bridge__buttons_target: "button", bridge_title: "Add board", bridge_display_title: true, bridge_icon_url: bridge_icon("board") } do %>
|
||||
data: { controller: "hotkey", action: "keydown.b@document->hotkey#click", bridge__buttons_target: "button", bridge_title: "Add board", bridge_display_title: true, bridge_icon_url: bridge_icon("board"), bridge_slot: "left" } do %>
|
||||
<%= icon_tag "board" %>
|
||||
<span class="overflow-ellipsis">Add a board</span>
|
||||
<kbd class="hide-on-touch">B</kbd>
|
||||
|
||||
Reference in New Issue
Block a user