Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions app/javascript/controllers/rating_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ export default class extends Controller {

connect() {
this.showRating()
this.boundHandleChange = this.handleChange.bind(this)
this.formTarget.addEventListener('change', this.boundHandleChange)
if (this.hasFormTarget) {
this.boundHandleChange = this.handleChange.bind(this)
this.formTarget.addEventListener('change', this.boundHandleChange)
}
}

disconnect() {
this.formTarget.removeEventListener('change', this.boundHandleChange)
if (this.hasFormTarget && this.boundHandleChange) {
this.formTarget.removeEventListener('change', this.boundHandleChange)
}
}

handleChange(event) {
Expand Down
2 changes: 1 addition & 1 deletion app/views/proposals/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- if proposal.speaker_can_withdraw?(current_user)
= proposal.withdraw_button
- if proposal.speaker_can_delete?(current_user)
= link_to event_proposal_path, data: {turbo: true, turbo_method: :delete, turbo_confirm: 'This will delete your talk. Are you sure you want to do this? It can not be undone.'}, class: 'btn btn-warning', id: 'delete' do
= link_to event_proposal_path(event, uuid: proposal), data: {turbo: true, turbo_method: :delete, turbo_confirm: 'This will delete your talk. Are you sure you want to do this? It can not be undone.'}, class: 'btn btn-warning', id: 'delete' do
%span.bi.bi-exclamation-circle
Delete Proposal

Expand Down