mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-19 19:01:52 +00:00
Merge pull request #1450 from ChrisBuergi/fire-event-on-itext-object
Fire 'selection:changed' on IText object.
This commit is contained in:
commit
0572b99718
2 changed files with 4 additions and 0 deletions
|
|
@ -156,6 +156,7 @@
|
|||
selectAll: function() {
|
||||
this.selectionStart = 0;
|
||||
this.selectionEnd = this.text.length;
|
||||
this.fire('selection:changed');
|
||||
this.canvas && this.canvas.fire('text:selection:changed', { target: this });
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
* @mixes fabric.Observable
|
||||
*
|
||||
* @fires changed ("text:changed" when observing canvas)
|
||||
* @fires selection:changed ("text:selection:changed" when observing canvas)
|
||||
* @fires editing:entered ("text:editing:entered" when observing canvas)
|
||||
* @fires editing:exited ("text:editing:exited" when observing canvas)
|
||||
*
|
||||
|
|
@ -219,6 +220,7 @@
|
|||
*/
|
||||
setSelectionStart: function(index) {
|
||||
if (this.selectionStart !== index) {
|
||||
this.fire('selection:changed');
|
||||
this.canvas && this.canvas.fire('text:selection:changed', { target: this });
|
||||
}
|
||||
this.selectionStart = index;
|
||||
|
|
@ -231,6 +233,7 @@
|
|||
*/
|
||||
setSelectionEnd: function(index) {
|
||||
if (this.selectionEnd !== index) {
|
||||
this.fire('selection:changed');
|
||||
this.canvas && this.canvas.fire('text:selection:changed', { target: this });
|
||||
}
|
||||
this.selectionEnd = index;
|
||||
|
|
|
|||
Loading…
Reference in a new issue