-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
45 lines (41 loc) · 1.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="node_modules/@telekom/scale-components/dist/scale-components/scale-components.css"
/>
<script
type="module"
src="node_modules/@telekom/scale-components/dist/scale-components/scale-components.esm.js"
></script>
<link rel="stylesheet" href="styles.css" />
<title>Vanilla</title>
</head>
<body>
<div class="container" id="container">
<h1>Scale + Vanilla</h1>
<scale-tooltip content="Container" id="tooltip-container">
<div class="tooltip-container">
<scale-tooltip content="Tooltip" id="nested-tooltip" placement="right">
<scale-button>Hover me</scale-button>
</scale-tooltip>
</div>
</scale-tooltip>
</div>
<script>
const container = document.getElementById('container')
const ttcontainer = document.getElementById("tooltip-container");
container.addEventListener('scale-before-show', (event) => { if (event.target.id === 'tooltip-container') {console.log('showing parent', event.target.id)}})
container.addEventListener('scale-before-show', (event) => {
if (event.target.id === 'nested-tooltip') {
console.log('showing child', event.target.id);
ttcontainer.opened = false;
}
})
</script>
</body>
</html>