PR feedback

This commit is contained in:
Jay Ohms
2026-02-26 07:53:02 -05:00
parent 84c650ab25
commit 7427675fc8
4 changed files with 10 additions and 1 deletions
@@ -6,6 +6,8 @@ export default class extends BridgeComponent {
static targets = [ "button" ]
connect() {
super.connect()
if (!this.beforeUnloadHandler) {
this.beforeUnloadHandler = this.handleBeforeUnload.bind(this)
}
@@ -14,6 +16,8 @@ export default class extends BridgeComponent {
}
disconnect() {
super.disconnect()
if (this.beforeUnloadHandler) {
window.removeEventListener("beforeunload", this.beforeUnloadHandler)
}
@@ -7,6 +7,8 @@ export default class extends BridgeComponent {
static values = { submitTitle: String }
connect() {
super.connect()
if (!this.beforeUnloadHandler) {
this.beforeUnloadHandler = this.handleBeforeUnload.bind(this)
}
@@ -15,6 +17,8 @@ export default class extends BridgeComponent {
}
disconnect() {
super.disconnect()
if (this.beforeUnloadHandler) {
window.removeEventListener("beforeunload", this.beforeUnloadHandler)
}
@@ -5,6 +5,7 @@
<%= button_to card_closure_path(card), method: :delete, class: "btn btn--plain borderless fill-transparent" do %>
<span class="pad-inline-end">Undo</span>
<% end %>
<%= bridged_button_to_board(card.board) %>
</div>
<% else %>
<div class="card-perma__notch card-perma__notch--bottom">
@@ -14,5 +14,5 @@
<kbd class="txt-x-small hide-on-touch">d</kbd>
<% end %>
<%= bridged_button_to_board(@card.board) %>
<%= bridged_button_to_board(card.board) %>
</div>