Skip to content

Commit

Permalink
Different fix for no DOM nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Jun 2, 2022
1 parent 894bd68 commit dd986c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ class CodeplusGroup {
}
}
render() {
if (this.instances.length === 0) return;

let groupDiv = document.createElement("div");
groupDiv.className = "codeplus codeplus-group " + this.groupClass;

Expand Down Expand Up @@ -270,8 +272,6 @@ class Codeplus {

if (this.debug) console.log("Codeplus DOM nodes selected", this.domNodes);

if (this.domNodes.length === 0) return;

this.groups = this.getGroups(
Array.from(this.domNodes).map(
(node) =>
Expand Down

0 comments on commit dd986c9

Please sign in to comment.