From 22390ae54ba287848c4c4a29da37a1d0733efe3e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 15 Sep 2018 13:51:39 +0200 Subject: [PATCH] ES6 style --- src/commands/view/SelectComponent.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index 33d0e7e2c..2ad90aaab 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -421,17 +421,24 @@ module.exports = { } const { store, selectedHandler, config } = options; - const { keyHeight, keyWidth, autoHeight, autoWidth } = config; + const { + keyHeight, + keyWidth, + autoHeight, + autoWidth, + unitWidth, + unitHeight + } = config; const onlyHeight = ['tc', 'bc'].indexOf(selectedHandler) >= 0; const onlyWidth = ['cl', 'cr'].indexOf(selectedHandler) >= 0; const style = modelToStyle.getStyle(); if (!onlyHeight) { - style[keyWidth] = autoWidth ? 'auto' : rect.w + config.unitWidth; + style[keyWidth] = autoWidth ? 'auto' : `${rect.w}${unitWidth}`; } if (!onlyWidth) { - style[keyHeight] = autoHeight ? 'auto' : rect.h + config.unitHeight; + style[keyHeight] = autoHeight ? 'auto' : `${rect.h}${unitHeight}`; } modelToStyle.setStyle(style, { avoidStore: 1 });