diff --git a/src/canvas/view/FrameView.js b/src/canvas/view/FrameView.js index 344b13b1a..c87608e95 100644 --- a/src/canvas/view/FrameView.js +++ b/src/canvas/view/FrameView.js @@ -31,6 +31,7 @@ export default Backbone.View.extend({ this.listenTo(model, 'change:x change:y', this.updatePos); this.listenTo(this.em, 'change:device', this.updateDim); this.updatePos(); + model.view = this; }, updatePos(md) { diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index d69d8b7fd..acc5c1b18 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -48,12 +48,21 @@ export default { const methods = { on, off }; const body = this.getCanvasBody(); const win = this.getContentWindow(); - methods[method](body, 'mouseover', this.onHover); - methods[method](body, 'mouseout', this.onOut); - methods[method](body, 'click touchend', this.onClick); - methods[method](win, 'scroll resize', this.onFrameScroll); - em[method]('component:toggled', this.onSelect, this); - em[method]('change:componentHovered', this.onHovered, this); + const trigger = (win, body) => { + methods[method](body, 'mouseover', this.onHover); + methods[method](body, 'mouseout', this.onOut); + methods[method](body, 'click touchend', this.onClick); + methods[method](win, 'scroll resize', this.onFrameScroll); + em[method]('component:toggled', this.onSelect, this); + em[method]('change:componentHovered', this.onHovered, this); + }; + trigger(win, body); + em.get('Canvas') + .getFrames() + .forEach(frame => { + const { view } = frame; + trigger(view.getWindow(), view.getBody()); + }); }, /**