diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 9f082a399..08ca0a19b 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -1,4 +1,4 @@ -import { isUndefined, defaults } from 'underscore'; +import { isUndefined, isElement, defaults } from 'underscore'; const deps = [ require('utils'), @@ -217,20 +217,13 @@ module.exports = Backbone.Model.extend({ /** * Select a component * @param {Component|HTMLElement} el Component to select - * @param {Object} opts Options, optional + * @param {Object} [opts={}] Options, optional * @private */ setSelected(el, opts = {}) { let model = el; - - if (el instanceof window.HTMLElement) { - model = $(el).data('model'); - } - - if (model && !model.get('selectable')) { - return; - } - + isElement(el) && (model = $(el).data('model')); + if (model && !model.get('selectable')) return; this.set('selectedComponent', model, opts); },