Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularization: move bootstrap tooltip code to its own file #291

Closed
Janell-Huyck opened this issue Nov 16, 2023 · 0 comments · Fixed by #292
Closed

Modularization: move bootstrap tooltip code to its own file #291

Janell-Huyck opened this issue Nov 16, 2023 · 0 comments · Fixed by #292
Assignees

Comments

@Janell-Huyck
Copy link
Contributor

Janell-Huyck commented Nov 16, 2023

This specific issue is related to moving the bootstrap tooltip initialization code,
$(document).on('turbolinks:load', function() {
$('[data-toggle="tooltip"]').tooltip();
})

In the header comment of app/assets/javascripts/application.js, we are instructed by the boilerplate to not place any code within the file, yet there is javascript code within the file. This issue is one of a handful for separating out individual javascript code into its own files and including them in the application.js file.

Example:

//= require some-file
//= require another-file

function some-function() {
-code-
}

some-function should be moved into its own file within app/assets/javascripts, perhaps as app/assets/javascripts/some-function.js. Then, within application.js, we need to require that new file with:
//= require some-function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants