-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Convert Tooltip from Coffeescript to Javascript #2548
Convert Tooltip from Coffeescript to Javascript #2548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is so small. Do you think we can get rid of jQuery as well?
0fc5a29
to
0adce11
Compare
I rewrote the file to use vanilla JS |
527772d
to
49e15d2
Compare
* @param {string} text | ||
* @returns {HTMLElement} | ||
*/ | ||
export function createHtmlElement(text) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think createElement
is a good enough name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just saw that with the custom element rewrite we lost the ability to init tooltips by data attribute (what we do a lot)
Ignore me, I just found that we only use the Very confusing. Maybe worth refactoring into one component? |
38566b7
to
6420efa
Compare
Move the tooltip also to the app/javascript folder and import the file only in the GUI init - function. It isn't used anywhere else.
Add a dom_helper.js to collect a few repetitive functions.
The tooltip component can only be used on input fields. This way the update of the form builder is way easier. The previous function to transform the jQuery scope to a HTMLElement was removed and the dom helpers - modules is now in the utils folder.
6420efa
to
0cfaf5b
Compare
What is this pull request for?
Move the tooltip also to the app/javascript folder and import the file only in the GUI init - function. It isn't used anywhere else.
Checklist