gd-bs 5.9.6 → 5.9.7

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.
@@ -54,14 +54,17 @@ var configureParent = function (component, parent) {
54
54
  exports.configureParent = configureParent;
55
55
  var setClassNames = function (el, className) {
56
56
  if (className === void 0) { className = ""; }
57
- // Set the class names
58
- var classNames = className.split(' ');
59
- for (var i = 0; i < classNames.length; i++) {
60
- // Ensure the class name exists
61
- var className_1 = classNames[i];
62
- if (className_1) {
63
- // Add the class
64
- el.classList.add(className_1);
57
+ // Ensure the element exists
58
+ if (el) {
59
+ // Set the class names
60
+ var classNames = className.split(' ');
61
+ for (var i = 0; i < classNames.length; i++) {
62
+ // Ensure the class name exists
63
+ var className_1 = classNames[i];
64
+ if (className_1) {
65
+ // Add the class
66
+ el.classList.add(className_1);
67
+ }
65
68
  }
66
69
  }
67
70
  };
@@ -28,7 +28,7 @@ var NavbarItem = /** @class */ (function () {
28
28
  }
29
29
  // Configures the item
30
30
  NavbarItem.prototype.configure = function () {
31
- var link = null;
31
+ var link = this._el.querySelector("a");
32
32
  // See if this is a dropdown
33
33
  if (this._props.items) {
34
34
  // Render a dropdown menu
@@ -54,7 +54,6 @@ var NavbarItem = /** @class */ (function () {
54
54
  // Else, ensure there is text
55
55
  else if (this._props.text) {
56
56
  // Update the link
57
- link = this._el.querySelector("a");
58
57
  if (link) {
59
58
  this._props.isActive ? link.classList.add("active") : link.removeChild(link.querySelector('span'));
60
59
  link.innerHTML = this._props.text == null ? "" : this._props.text;