Skip to content

Commit

Permalink
Implement toggle and ESC event for address menu
Browse files Browse the repository at this point in the history
  • Loading branch information
rainerdema committed Nov 15, 2023
1 parent 2ec4e2d commit 51631c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<%= tag.a(
href: solidus_admin.send("order_#{@type}_address_path", @order, address_id: address.id),
class: 'block text-black text-sm hover:bg-gray-50 p-2 mx-2 w-auto rounded-lg',
'data-action': "#{stimulus_id}#close",
) do %>
<%= format_address(address) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Controller } from '@hotwired/stimulus'

export default class extends Controller {
static targets = ["userAddresses"]

close() {
this.userAddressesTarget.removeAttribute('open')
}
}

0 comments on commit 51631c2

Please sign in to comment.