From d984b258a982a25b4054c190be3846a1fe0d369a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 17 Jun 2020 14:05:51 +0200 Subject: [PATCH] Add the possibility to change block attributes dynamically --- src/block_manager/view/BlockView.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/block_manager/view/BlockView.js b/src/block_manager/view/BlockView.js index c497d06ac..8987a3441 100644 --- a/src/block_manager/view/BlockView.js +++ b/src/block_manager/view/BlockView.js @@ -139,7 +139,7 @@ export default Backbone.View.extend({ }, render() { - const { em, el, ppfx, model } = this; + const { em, el, $el, ppfx, model } = this; const disable = model.get('disable'); const attr = model.get('attributes') || {}; const cls = attr.class || ''; @@ -149,6 +149,7 @@ export default Backbone.View.extend({ const render = model.get('render'); const media = model.get('media'); const clsAdd = disable ? `${className}--disable` : `${ppfx}four-color-h`; + $el.attr(attr); el.className = `${cls} ${className} ${ppfx}one-bg ${clsAdd}`.trim(); el.innerHTML = ` ${media ? `
${media}
` : ''}