File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,25 @@ Now, require bootstrap from any of your JavaScript files:
73
73
$ (' [data-toggle="popover"]' ).popover ();
74
74
});
75
75
76
+ Using Bootstrap with Turbo
77
+ ---------------------------
78
+
79
+ If you are using bootstrap with Turbo Drive, to allow your JavaScript to load on each page change,
80
+ wrap the initialization in a ``turbo:load `` event listener:
81
+
82
+ .. code-block :: javascript
83
+
84
+ // app.js
85
+
86
+ // this waits for Turbo Drive to load
87
+ document .addEventListener (' turbo:load' , function (e ) {
88
+ // this enables bootstrap tooltips globally
89
+ let tooltipTriggerList = [].slice .call (document .querySelectorAll (' [data-bs-toggle="tooltip"]' ))
90
+ let tooltipList = tooltipTriggerList .map (function (tooltipTriggerEl ) {
91
+ return new Tooltip (tooltipTriggerEl)
92
+ });
93
+ });
94
+
76
95
Using other Bootstrap / jQuery Plugins
77
96
--------------------------------------
78
<
3AAB
/td>97
You can’t perform that action at this time.
0 commit comments