Skip to content

Commit

Permalink
fix(): include null items
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGysemans committed Apr 28, 2021
1 parent e25a2a7 commit 9afc46f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.1.3] - April 28, 2021

Bug fixes

## [1.1.2] - April 25, 2021

Bug fixes
Expand Down
8 changes: 5 additions & 3 deletions src/JSPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,17 @@ class JSPanel {
if (this.options.items) {
const container = this._createEl("div", { className: "container-items" });
for (let item of this.options.items) {
const built_item = this._buildItem(item);
container.appendChild(built_item);
if (item) {
const built_item = this._buildItem(item);
container.appendChild(built_item);
}
}
this.panel.appendChild(container);
}
else {
throw new Error("You need to define items to be displayed in the panel.");
}
//
//
// events
//
document.addEventListener("click", (e) => {
Expand Down
8 changes: 5 additions & 3 deletions src/JSPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,17 @@ class JSPanel {
if (this.options.items) {
const container = this._createEl("div", { className: "container-items" });
for (let item of this.options.items) {
const built_item = this._buildItem(item);
container.appendChild(built_item);
if (item) {
const built_item = this._buildItem(item);
container.appendChild(built_item);
}
}
this.panel.appendChild(container);
} else {
throw new Error("You need to define items to be displayed in the panel.");
}

//
//
// events
//

Expand Down

0 comments on commit 9afc46f

Please sign in to comment.