Browse Source

Update on select strategy

pull/2524/head
Artur Arseniev 7 years ago
parent
commit
fa812055a2
  1. 5
      src/commands/view/SelectComponent.js
  2. 2
      src/style_manager/view/SectorsView.js

5
src/commands/view/SelectComponent.js

@ -126,8 +126,9 @@ export default {
* @param {Object} el * @param {Object} el
* @private * @private
* */ * */
onSelect(component) { onSelect() {
const { em } = this; const { em } = this;
const component = em.getSelected();
const currentFrame = em.get('currentFrame') || {}; const currentFrame = em.get('currentFrame') || {};
const prevComp = this.getElSelected().component; const prevComp = this.getElSelected().component;
if (component && component === prevComp) return; if (component && component === prevComp) return;
@ -716,6 +717,7 @@ export default {
const { el, pos, component } = this.getElSelected(); const { el, pos, component } = this.getElSelected();
if (!el) { if (!el) {
this.toggleToolsEl(); // Hides toolbar
this.lastSelected = 0; this.lastSelected = 0;
return; return;
} }
@ -732,7 +734,6 @@ export default {
const frameOff = this.frameRectOffset(el, pos); const frameOff = this.frameRectOffset(el, pos);
const topOff = frameOff.top; const topOff = frameOff.top;
const leftOff = frameOff.left; const leftOff = frameOff.left;
console.log({ el, frameOff });
style.top = topOff + unit; style.top = topOff + unit;
style.left = leftOff + unit; style.left = leftOff + unit;
style.width = pos.width + unit; style.width = pos.width + unit;

2
src/style_manager/view/SectorsView.js

@ -43,7 +43,7 @@ export default Backbone.View.extend({
* Fired when target is updated * Fired when target is updated
* @private * @private
*/ */
targetUpdated() { targetUpdated(cmp) {
const em = this.target; const em = this.target;
const pt = this.propTarget; const pt = this.propTarget;
let model = em.getSelected(); let model = em.getSelected();

Loading…
Cancel
Save