Skip to content

Commit 3da3099

Browse files
authored
Merge pull request #852 from amatsuda/bs5_popover
Globally initialize popovers by Bootstrap 5
2 parents 46ad924 + afcf5b3 commit 3da3099

File tree

5 files changed

+5
-26
lines changed

5 files changed

+5
-26
lines changed

app/javascript/application.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ document.addEventListener('DOMContentLoaded', () => {
1212
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => {
1313
new bootstrap.Tooltip(el)
1414
})
15+
document.querySelectorAll('[data-bs-toggle="popover"]').forEach(el => {
16+
new bootstrap.Popover(el)
17+
})
1518
})
1619

1720
import "@hotwired/turbo-rails"

app/javascript/controllers/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import MultiselectController from "./multiselect_controller"
3636
import NestedFormController from "./nested_form_controller"
3737
import NextProposalController from "./next_proposal_controller"
3838
import NotificationsChannelController from "./notifications_channel_controller"
39-
import PopoverController from "./popover_controller"
4039
import ProgramSessionsController from "./program_sessions_controller"
4140
import ProposalPreviewController from "./proposal_preview_controller"
4241
import ProposalSelectController from "./proposal_select_controller"
@@ -86,7 +85,6 @@ application.register("multiselect", MultiselectController)
8685
application.register("nested-form", NestedFormController)
8786
application.register("next-proposal", NextProposalController)
8887
application.register("notifications-channel", NotificationsChannelController)
89-
application.register("popover", PopoverController)
9088
application.register("program-sessions", ProgramSessionsController)
9189
application.register("proposal-preview", ProposalPreviewController)
9290
application.register("proposal-select", ProposalSelectController)

app/javascript/controllers/popover_controller.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/views/profiles/edit.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
%i.fa.fa-envelope
7373
%h3
7474
Notifications
75-
%span.ms-2{role: 'button', data: {controller: 'popover', bs_toggle: 'popover', bs_placement: 'left', bs_content: notification_preferences_tooltip, bs_html: 'true'}}
75+
%span.ms-2{role: 'button', data: {bs_toggle: 'popover', bs_placement: 'left', bs_content: notification_preferences_tooltip, bs_html: 'true'}}
7676
%i.fa.fa-question-circle
7777
.widget-content
7878
= f.simple_fields_for :teammates do |fields|

app/views/shared/proposals/_rating_form.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
= simple_form_for [event, :staff, proposal, rating], data: {rating_target: 'form', turbo_frame: dom_id(proposal, :rating_widget), remote: false} do |f|
66
= program_tracker
77
- unless disabled
8-
%span.me-2{role: 'button', id: 'rating-tooltip-toggle', data: {controller: 'popover', bs_toggle: 'popover', bs_placement: 'left', bs_content: rating_tooltip, bs_html: 'true'}}
8+
%span.me-2{role: 'button', id: 'rating-tooltip-toggle', data: {bs_toggle: 'popover', bs_placement: 'left', bs_content: rating_tooltip, bs_html: 'true'}}
99
%i.fa.fa-question-circle
1010
= f.label :score, "Rating"
1111
.rating-form-wrapper

0 commit comments

Comments
 (0)