-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Docs(web): Add Tooltip demo #DS-914
- Loading branch information
1 parent
12fa95c
commit 67d4c46
Showing
2 changed files
with
19 additions
and
16 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/web/src/scss/components/Tooltip/dismissible-tooltip.mjs
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 Tooltip from '../../../js/Tooltip.ts'; | ||
|
||
const myTooltipEl = document.getElementById('my-dismissible-tooltip2'); | ||
const myTooltip = new Tooltip(myTooltipEl); | ||
|
||
// Remove 'my-tooltip' key from localStorage to show tooltip again. | ||
// localStorage.removeItem('my-tooltip'); | ||
|
||
if (!window.localStorage.getItem('my-tooltip')) { | ||
myTooltip.show(); | ||
} | ||
|
||
document.getElementById('my-dismissible-tooltip2-button').addEventListener('click', () => { | ||
myTooltip.hide(); | ||
window.localStorage.setItem('my-tooltip', true); | ||
}); |
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