|
|
@ -13,7 +13,7 @@ export default Backbone.View.extend({ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
initialize(o) { |
|
|
initialize(o) { |
|
|
bindAll(this, 'udpateOffset'); |
|
|
bindAll(this, 'updateOffset'); |
|
|
this.config = o.config || {}; |
|
|
this.config = o.config || {}; |
|
|
this.ppfx = this.config.pStylePrefix || ''; |
|
|
this.ppfx = this.config.pStylePrefix || ''; |
|
|
this.em = this.config.em; |
|
|
this.em = this.config.em; |
|
|
@ -45,19 +45,19 @@ export default Backbone.View.extend({ |
|
|
const noChanges = currW == newW && currH == newH; |
|
|
const noChanges = currW == newW && currH == newH; |
|
|
style.width = newW; |
|
|
style.width = newW; |
|
|
style.height = newH; |
|
|
style.height = newH; |
|
|
this.udpateOffset(); |
|
|
this.updateOffset(); |
|
|
// Prevent fixed highlighting box which appears when on
|
|
|
// Prevent fixed highlighting box which appears when on
|
|
|
// component hover during the animation
|
|
|
// component hover during the animation
|
|
|
em.stopDefault({ preserveSelected: 1 }); |
|
|
em.stopDefault({ preserveSelected: 1 }); |
|
|
noChanges ? this.udpateOffset() : $el.on(motionsEv, this.udpateOffset); |
|
|
noChanges ? this.updateOffset() : $el.on(motionsEv, this.updateOffset); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
udpateOffset() { |
|
|
updateOffset() { |
|
|
const em = this.em; |
|
|
const em = this.em; |
|
|
const offset = em.get('Canvas').getOffset(); |
|
|
const offset = em.get('Canvas').getOffset(); |
|
|
em.set('canvasOffset', offset); |
|
|
em.set('canvasOffset', offset); |
|
|
em.runDefault({ preserveSelected: 1 }); |
|
|
em.runDefault({ preserveSelected: 1 }); |
|
|
this.$el.off(motionsEv, this.udpateOffset); |
|
|
this.$el.off(motionsEv, this.updateOffset); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getDoc() { |
|
|
getDoc() { |
|
|
|