From 5e3594522ff36a6230d9b05aef6fa35645f8c166 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 31 Jan 2018 18:04:16 +0100 Subject: [PATCH] Use isElement in index.js --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 2a28522ac..1d4a22d02 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,8 @@ import $ from 'cash-dom'; import Editor from './editor'; -import PluginManager from './plugin_manager'; +import { isElement } from 'underscore'; import polyfills from 'utils/polyfills'; +import PluginManager from './plugin_manager'; polyfills(); @@ -48,8 +49,7 @@ module.exports = (() => { const els = config.container; if (!els) throw new Error("'container' is required"); config = { ...defaultConfig, ...config }; - const ilEl = els instanceof window.HTMLElement; - config.el = ilEl ? els : document.querySelector(els); + config.el = isElement(els) ? els : document.querySelector(els); const editor = new Editor(config).init(); // Load plugins