Compare commits
2 Commits
7c43a4d919
...
74666130c0
Author | SHA1 | Date | |
---|---|---|---|
74666130c0 | |||
c43e43d89c |
@ -1,4 +1,4 @@
|
|||||||
<%= link_to @href, class: @class, data: {
|
<%= link_to @href, class: @class, target: @target, data: {
|
||||||
'dropdown-target': "menuItem",
|
'dropdown-target': "menuItem",
|
||||||
'action': "keydown.up->dropdown#previousItem:prevent keydown.down->dropdown#nextItem:prevent"
|
'action': "keydown.up->dropdown#previousItem:prevent keydown.down->dropdown#nextItem:prevent"
|
||||||
} do %>
|
} do %>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class DropdownLinkComponent < ViewComponent::Base
|
class DropdownLinkComponent < ViewComponent::Base
|
||||||
def initialize(href:, separator: false, add_class: nil)
|
def initialize(href:, open_in_new_tab: false, separator: false, add_class: nil)
|
||||||
@href = href
|
@href = href
|
||||||
|
@target = open_in_new_tab ? "_blank" : nil
|
||||||
@class = class_str(separator, add_class)
|
@class = class_str(separator, add_class)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<%= render DropdownComponent.new do %>
|
<%= render DropdownComponent.new do %>
|
||||||
<%= render DropdownLinkComponent.new(
|
<%= render DropdownLinkComponent.new(
|
||||||
href: launch_app_services_storage_rs_auth_url(@auth)
|
href: launch_app_services_storage_rs_auth_url(@auth),
|
||||||
|
open_in_new_tab: true
|
||||||
) do %>
|
) do %>
|
||||||
Launch app
|
Launch app
|
||||||
<% end %>
|
<% end %>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user