|
|
|
@ -27,11 +27,18 @@ module.exports = require('backbone').View.extend({ |
|
|
|
const em = this.em; |
|
|
|
const device = em.getDeviceModel(); |
|
|
|
const style = this.el.style; |
|
|
|
style.width = device ? device.get('width') : ''; |
|
|
|
style.height = device ? device.get('height') : ''; |
|
|
|
const currW = style.width || ''; |
|
|
|
const currH = style.height || ''; |
|
|
|
const newW = device ? device.get('width') : ''; |
|
|
|
const newH = device ? device.get('height') : ''; |
|
|
|
const noChanges = currW == newW && currH == newH; |
|
|
|
style.width = newW; |
|
|
|
style.height = newH; |
|
|
|
this.udpateOffset(); |
|
|
|
// Prevent fixed highlighting box which appears when on
|
|
|
|
// component hover during the animation
|
|
|
|
em.stopDefault({ preserveSelected: 1 }); |
|
|
|
this.$el.on(motionsEv, this.udpateOffset); |
|
|
|
noChanges ? this.udpateOffset() : this.$el.on(motionsEv, this.udpateOffset); |
|
|
|
}, |
|
|
|
|
|
|
|
udpateOffset() { |
|
|
|
|