From 88e957dd805a60edc97d34d3ce153ace5eb06200 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 6 Aug 2021 17:01:51 +0200 Subject: [PATCH] Refactor editor --- src/editor/model/Editor.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 66fbbdef2..b67d66003 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -529,14 +529,12 @@ export default Backbone.Model.extend({ * @private */ getHtml(opts = {}) { - const config = this.config; - const { optsHtml } = config; - const exportWrapper = config.exportWrapper; - const wrapperIsBody = config.wrapperIsBody; + const { config } = this; + const { optsHtml, exportWrapper, wrapperIsBody } = config; const js = config.jsInHtml ? this.getJs(opts) : ''; - var wrp = opts.component || this.get('DomComponents').getComponent(); - var html = wrp - ? this.get('CodeManager').getCode(wrp, 'html', { + const cmp = opts.component || this.get('DomComponents').getComponent(); + let html = cmp + ? this.get('CodeManager').getCode(cmp, 'html', { exportWrapper, wrapperIsBody, ...optsHtml, @@ -555,8 +553,7 @@ export default Backbone.Model.extend({ */ getCss(opts = {}) { const config = this.config; - const { optsCss } = config; - const wrapperIsBody = config.wrapperIsBody; + const { optsCss, wrapperIsBody } = config; const avoidProt = opts.avoidProtected; const keepUnusedStyles = !isUndefined(opts.keepUnusedStyles) ? opts.keepUnusedStyles