-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
ec0b7e5
commit 0cfaf5b
Showing
6 changed files
with
21 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createHtmlElement, wrap } from "alchemy_admin/utils/dom_helpers" | ||
|
||
/** | ||
* show tooltips on fixed inputs | ||
*/ | ||
class Tooltip extends HTMLInputElement { | ||
constructor() { | ||
super() | ||
|
||
const text = this.dataset.tooltip | ||
wrap(this, createHtmlElement('<div class="with-hint" />')) | ||
this.after(createHtmlElement(`<span class="hint-bubble">${text}</span>`)) | ||
} | ||
} | ||
|
||
customElements.define("alchemy-tooltip", Tooltip, { extends: "input" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters