Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hcodes committed Dec 27, 2017
1 parent e7f9c57 commit 31acb3c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/js/snowflakes.js
Expand Up @@ -169,15 +169,21 @@ class Snowflakes {
Snowflakes._count--;
if (Snowflakes._count <= 0) {
Snowflakes._count = 0;
Snowflakes._mainStyleNode.parentNode.removeChild(Snowflakes._mainStyleNode);
delete Snowflakes._mainStyleNode;
if (Snowflakes._mainStyleNode) {
Snowflakes._mainStyleNode.parentNode.removeChild(Snowflakes._mainStyleNode);
delete Snowflakes._mainStyleNode;
}
}

this._animationStyleNode.parentNode.removeChild(this._animationStyleNode);
delete this._animationStyleNode;
if (this._animationStyleNode) {
this._animationStyleNode.parentNode.removeChild(this._animationStyleNode);
delete this._animationStyleNode;
}

this._imagesStyleNode.parentNode.removeChild(this._imagesStyleNode);
delete this._imagesStyleNode;
if (this._imagesStyleNode) {
this._imagesStyleNode.parentNode.removeChild(this._imagesStyleNode);
delete this._imagesStyleNode;
}
}

_height() {
Expand Down

0 comments on commit 31acb3c

Please sign in to comment.