From 80170753f517531e318287e1c207ba3279b59a7d Mon Sep 17 00:00:00 2001 From: Yevhen Badorov Date: Fri, 14 Aug 2020 10:33:45 +0300 Subject: [PATCH] fix container to accept HTML elements Currently, selectors only acceptable. Passing an HTML element produces the error 'Container must either be a selector string or an HTMLElement.'. After the fix both selectors and HTML elements will work the same --- src/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/main.js b/src/js/main.js index 7f405b1..2e91475 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -245,7 +245,7 @@ class FunnelGraph { if (!this.container) { throw new Error(`Container cannot be found (selector: ${this.containerSelector}).`); } - } else if (this.container instanceof HTMLElement) { + } else if (this.containerSelector instanceof HTMLElement) { this.container = this.containerSelector; } else { throw new Error('Container must either be a selector string or an HTMLElement.');