import { $ } from '../../common'; import { CommandObject } from './CommandAbstract'; export default { run(editor, sender) { this.sender = sender; if (!this.$cnt) { const config = editor.getConfig(); const { Panels, DeviceManager, SelectorManager, StyleManager } = editor; const trgEvCnt = 'change:appendContent'; const $cnt = $('
'); const $cntInner = $(''); const $cntSlm = $(''); const $cntSm = $(''); this.$cnt = $cnt; this.$cntInner = $cntInner; $cntInner.append($cntSlm); $cntInner.append($cntSm); $cnt.append($cntInner); // Device Manager if (DeviceManager && config.showDevices) { const devicePanel = Panels.addPanel({ id: 'devices-c' }); const dvEl = DeviceManager.render(); devicePanel.set('appendContent', dvEl).trigger(trgEvCnt); } // Selector Manager container const slmConfig = SelectorManager.getConfig(); if (slmConfig.custom) { SelectorManager.__trgCustom({ container: $cntSlm.get(0) }); } else if (!slmConfig.appendTo) { $cntSlm.append(SelectorManager.render([])); } // Style Manager this.sm = StyleManager; const smConfig = StyleManager.getConfig(); const pfx = smConfig.stylePrefix; this.$header = $(`