Skip to content

Commit

Permalink
Fix broken wrapper div option & naming conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
daveknights committed Oct 3, 2023
1 parent 3f2cbb5 commit 8610f6f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cre8bit.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,16 @@ export default class Cre8bit {
}

#characterPath() {
let char = this.#characterName;
let charName = this.#characterName;

switch (this.#characterName) {
switch (charName) {
case 'space invader':
char = 'spaceInvader';
return this.#characters[char];
return this.#characters['spaceInvader'];
case 'poke ball':
char = 'pokeBall';
return this.#characters[char];
return this.#characters['pokeBall'];
default:
if (char in this.#characters) {
return this.#characters[char];
if (charName in this.#characters) {
return this.#characters[charName];
} else {
console.log('Character not available');
}
Expand Down Expand Up @@ -354,7 +352,7 @@ export default class Cre8bit {
shape = this.#makeSVG(svgElem, newCharPath);

if (options && options.wrapperClass) {
child = this.#createSvgElement('div');
child = document.createElement('div');
child.className = options.wrapperClass;

child.appendChild(shape);
Expand Down

0 comments on commit 8610f6f

Please sign in to comment.