Browse Source

"Udpate" typo fix

pull/2158/head
Juan 7 years ago
parent
commit
70bbfe09d7
  1. 2
      src/canvas/view/CanvasView.js
  2. 10
      src/canvas/view/FrameView.js
  3. 8
      src/utils/Sorter.js

2
src/canvas/view/CanvasView.js

@ -262,7 +262,7 @@ export default Backbone.View.extend({
body.append(this.getJsContainer()); body.append(this.getJsContainer());
em.trigger('loaded'); em.trigger('loaded');
this.frame.el.contentWindow.onscroll = this.onFrameScroll; this.frame.el.contentWindow.onscroll = this.onFrameScroll;
this.frame.udpateOffset(); this.frame.updateOffset();
// Avoid the default link behaviour in the canvas // Avoid the default link behaviour in the canvas
body.on( body.on(

10
src/canvas/view/FrameView.js

@ -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() {

8
src/utils/Sorter.js

@ -27,7 +27,7 @@ export default Backbone.View.extend({
'onMove', 'onMove',
'endMove', 'endMove',
'rollback', 'rollback',
'udpateOffset', 'updateOffset',
'moveDragHelper' 'moveDragHelper'
); );
var o = opt || {}; var o = opt || {};
@ -69,8 +69,8 @@ export default Backbone.View.extend({
this.activeTextModel = null; this.activeTextModel = null;
if (this.em && this.em.on) { if (this.em && this.em.on) {
this.em.on('change:canvasOffset', this.udpateOffset); this.em.on('change:canvasOffset', this.updateOffset);
this.udpateOffset(); this.updateOffset();
} }
}, },
@ -98,7 +98,7 @@ export default Backbone.View.extend({
/** /**
* Triggered when the offset of the editro is changed * Triggered when the offset of the editro is changed
*/ */
udpateOffset() { updateOffset() {
const offset = this.em.get('canvasOffset') || {}; const offset = this.em.get('canvasOffset') || {};
this.offTop = offset.top; this.offTop = offset.top;
this.offLeft = offset.left; this.offLeft = offset.left;

Loading…
Cancel
Save