Index: trunk/extensions/VisualEditor/modules/es/models/es.SurfaceModel.js |
— | — | @@ -70,13 +70,11 @@ |
71 | 71 | } |
72 | 72 | // Filter out calls to select if they do not change the selection values |
73 | 73 | this.selection = selection; |
74 | | - if ( |
75 | | - !combine || |
76 | | - !this.previousSelection || ( |
77 | | - this.previousSelection.from !== this.selection.from || |
78 | | - this.previousSelection.to !== this.selection.to |
79 | | - ) |
80 | | - ) { |
| 74 | + var selectionChanged = !this.previousSelection || ( |
| 75 | + this.previousSelection.from !== this.selection.from || |
| 76 | + this.previousSelection.to !== this.selection.to |
| 77 | + ); |
| 78 | + if ( !combine || selectionChanged ) { |
81 | 79 | var lastAction = this.states[this.states.length - 1]; |
82 | 80 | if ( lastAction instanceof es.Range ) { |
83 | 81 | this.currentStateDistance += Math.abs( |
— | — | @@ -84,7 +82,9 @@ |
85 | 83 | ); |
86 | 84 | } |
87 | 85 | this.currentState.push( selection ); |
88 | | - this.emit( 'select', this.selection.clone() ); |
| 86 | + if ( selectionChanged ) { |
| 87 | + this.emit( 'select', this.selection.clone() ); |
| 88 | + } |
89 | 89 | } |
90 | 90 | this.previousSelection = this.selection.clone(); |
91 | 91 | }; |