Browse Source

ES6 style

pull/1446/head
Artur Arseniev 8 years ago
parent
commit
22390ae54b
  1. 13
      src/commands/view/SelectComponent.js

13
src/commands/view/SelectComponent.js

@ -421,17 +421,24 @@ module.exports = {
} }
const { store, selectedHandler, config } = options; 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 onlyHeight = ['tc', 'bc'].indexOf(selectedHandler) >= 0;
const onlyWidth = ['cl', 'cr'].indexOf(selectedHandler) >= 0; const onlyWidth = ['cl', 'cr'].indexOf(selectedHandler) >= 0;
const style = modelToStyle.getStyle(); const style = modelToStyle.getStyle();
if (!onlyHeight) { if (!onlyHeight) {
style[keyWidth] = autoWidth ? 'auto' : rect.w + config.unitWidth; style[keyWidth] = autoWidth ? 'auto' : `${rect.w}${unitWidth}`;
} }
if (!onlyWidth) { if (!onlyWidth) {
style[keyHeight] = autoHeight ? 'auto' : rect.h + config.unitHeight; style[keyHeight] = autoHeight ? 'auto' : `${rect.h}${unitHeight}`;
} }
modelToStyle.setStyle(style, { avoidStore: 1 }); modelToStyle.setStyle(style, { avoidStore: 1 });

Loading…
Cancel
Save