Browse Source

Use isElement in index.js

pull/856/head
Artur Arseniev 9 years ago
parent
commit
5e3594522f
  1. 6
      src/index.js

6
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

Loading…
Cancel
Save