Skip to content

Commit 32fc986

Browse files
committed
comment code
1 parent 7de40c9 commit 32fc986

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

web-components/course-card/course-card.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ h3 {
1414

1515
p {
1616
font-size: 1.125em;
17-
line-height: 1.5;
1817
}
1918

2019
a {

web-components/course-card/course-card.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,28 @@ function createComponent(html) {
2222
selector.textContent = content;
2323
}
2424

25+
/**
26+
* Sets the link of an element based on a CSS selector.
27+
* @param {string} cssSelector - The CSS selector of the element to set the link for.
28+
* @param {string} url - The link url.
29+
* @param {string} name - The name of the element containing the link.
30+
* @param {string} linkText - The link text.
31+
* @param {boolean} shadow - A boolean indicating whether to use the shadow DOM for the element.
32+
* @returns {void}
33+
*/
2534
function setLink(cssSelector, url, name, linkText, shadow) {
2635
const link = shadow.querySelector(cssSelector);
2736
link.href = url;
2837
link.setAttribute('aria-label', `Learn more about ${name}`);
2938
link.textContent = linkText;
3039
}
3140

41+
/**
42+
* Hides the content of an element based on a CSS selector.
43+
* @param {string} cssSelector - The CSS selector of the element to hide.
44+
* @param {boolean} shadow - A boolean indicating whether to use the shadow DOM for the element.
45+
* @returns {void}
46+
*/
3247
function hideContent(cssSelector, shadow) {
3348
const selector = shadow.querySelector(cssSelector);
3449
selector.style.display = 'none';
@@ -112,10 +127,8 @@ function createComponent(html) {
112127
// Update link text
113128
linkText = 'Register →'
114129
}
115-
116130
// Set course link
117131
setLink('.course-link', this.link, this.name, linkText, shadow);
118-
119132
}
120133
}
121134

0 commit comments

Comments
 (0)