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

fix(autoalign): fix autoalign CSB example #11572

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<html>
<head>
<title>@carbon/ibmdotcom-web-components example</title>
<title>@carbon/web-components autoalign example</title>
<meta charset="UTF-8" />
<link
rel="stylesheet"
Expand Down Expand Up @@ -144,16 +144,18 @@ <h1>84%</h1>
</div>

<script>
_handleClick = () => {
const popover = document.querySelector("cds-popover");
const open = popover?.hasAttribute("open");
open
? popover?.removeAttribute("open")
: popover?.setAttribute("open", "");
_handleClick = () => {
const popover = document.querySelector('cds-popover');
if (popover) {
const open = popover.hasAttribute('open');
open
? popover.removeAttribute('open')
: popover.setAttribute('open', '');
}
};

const trigger = document.querySelector(".playground-trigger");
trigger.addEventListener("click", _handleClick);
const trigger = document.querySelector('.playground-trigger');
trigger.addEventListener('click', _handleClick);
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<html>
<head>
<title>carbon-web-components example</title>
<title>@carbon/web-components autoalign example</title>
<meta charset="UTF-8" />
<link
rel="stylesheet"
Expand Down Expand Up @@ -129,15 +129,17 @@ <h1>84%</h1>

<script>
_handleClick = () => {
const popover = document.querySelector("cds-popover");
const open = popover?.hasAttribute("open");
open
? popover?.removeAttribute("open")
: popover?.setAttribute("open", "");
const popover = document.querySelector('cds-popover');
if (popover) {
const open = popover.hasAttribute('open');
open
? popover.removeAttribute('open')
: popover.setAttribute('open', '');
}
};

const trigger = document.querySelector(".playground-trigger");
trigger.addEventListener("click", _handleClick);
const trigger = document.querySelector('.playground-trigger');
trigger.addEventListener('click', _handleClick);
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "carbon-web-components-accordion-example",
"name": "carbon-web-components-autoalign-example",
"version": "0.1.0",
"private": true,
"description": "Sample project for getting started with the Web Components from Carbon.",
Expand Down
Loading