gd-bs 5.9.6 → 5.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/common.js +11 -8
- package/build/components/navbar/item.js +1 -2
- package/build/components/popover/index.js +1 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/common.ts +11 -8
- package/src/components/navbar/item.ts +1 -2
- package/src/components/popover/index.ts +1 -0
package/package.json
CHANGED
package/src/components/common.ts
CHANGED
|
@@ -50,14 +50,17 @@ export const configureParent = (component: Element, parent: Element): Element =>
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export const setClassNames = (el: HTMLElement, className = "") => {
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
// Ensure the element exists
|
|
54
|
+
if (el) {
|
|
55
|
+
// Set the class names
|
|
56
|
+
let classNames = className.split(' ');
|
|
57
|
+
for (let i = 0; i < classNames.length; i++) {
|
|
58
|
+
// Ensure the class name exists
|
|
59
|
+
let className = classNames[i];
|
|
60
|
+
if (className) {
|
|
61
|
+
// Add the class
|
|
62
|
+
el.classList.add(className);
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -31,7 +31,7 @@ export class NavbarItem {
|
|
|
31
31
|
|
|
32
32
|
// Configures the item
|
|
33
33
|
private configure() {
|
|
34
|
-
let link: HTMLAnchorElement =
|
|
34
|
+
let link: HTMLAnchorElement = this._el.querySelector("a");
|
|
35
35
|
|
|
36
36
|
// See if this is a dropdown
|
|
37
37
|
if (this._props.items) {
|
|
@@ -60,7 +60,6 @@ export class NavbarItem {
|
|
|
60
60
|
// Else, ensure there is text
|
|
61
61
|
else if (this._props.text) {
|
|
62
62
|
// Update the link
|
|
63
|
-
link = this._el.querySelector("a");
|
|
64
63
|
if (link) {
|
|
65
64
|
this._props.isActive ? link.classList.add("active") : link.removeChild(link.querySelector('span'));
|
|
66
65
|
link.innerHTML = this._props.text == null ? "" : this._props.text;
|