mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-20 06:00:59 +00:00
Update itext_behavior.mixin.js
This commit is contained in:
parent
57329b39be
commit
0e384be263
1 changed files with 18 additions and 13 deletions
|
|
@ -347,11 +347,27 @@
|
|||
return this;
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
this.canvas.renderAll();
|
||||
this.canvas.fire('text:editing:entered', { target: this });
|
||||
this.canvas.on('mouse:move', function(options) {
|
||||
this.initMouseMoveHandler();
|
||||
return this;
|
||||
},
|
||||
|
||||
exitEditingOnOthers: function() {
|
||||
fabric.IText.instances.forEach(function(obj) {
|
||||
obj.selected = false;
|
||||
if (obj.isEditing) {
|
||||
obj.exitEditing();
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Initializes "mousemove" event handler
|
||||
*/
|
||||
initMouseMoveHandler: function() {
|
||||
var _this = this;
|
||||
this.canvas.on('mouse:move', function(options) {
|
||||
if (!_this.__isMousedown || !_this.isEditing) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -366,17 +382,6 @@
|
|||
_this.setSelectionEnd(_this.__selectionStartOnMouseDown);
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
exitEditingOnOthers: function() {
|
||||
fabric.IText.instances.forEach(function(obj) {
|
||||
obj.selected = false;
|
||||
if (obj.isEditing) {
|
||||
obj.exitEditing();
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue