Index: trunk/extensions/VisualEditor/modules/es/es.TransactionProcessor.js |
— | — | @@ -175,7 +175,8 @@ |
176 | 176 | var i, |
177 | 177 | j, |
178 | 178 | length, |
179 | | - annotation; |
| 179 | + annotation, |
| 180 | + changes = 0; |
180 | 181 | // Handle annotations |
181 | 182 | if ( this.set.length ) { |
182 | 183 | for ( i = 0, length = this.set.length; i < length; i++ ) { |
— | — | @@ -193,6 +194,7 @@ |
194 | 195 | } |
195 | 196 | } |
196 | 197 | } |
| 198 | + changes++; |
197 | 199 | } |
198 | 200 | if ( this.clear.length ) { |
199 | 201 | for ( i = 0, length = this.clear.length; i < length; i++ ) { |
— | — | @@ -212,12 +214,13 @@ |
213 | 215 | } |
214 | 216 | } |
215 | 217 | } |
| 218 | + changes++; |
216 | 219 | } |
217 | | - if ( update ) { |
218 | | - var updates = this.model.selectNodes( new es.Range( this.cursor, to ) ); |
219 | | - for ( i = 0; i < updates.length; i++ ) { |
220 | | - updates[i].node.emit( 'update' ); |
221 | | - } |
| 220 | + if ( update && changes ) { |
| 221 | + var from = this.model.getNodeFromOffset( this.cursor ); |
| 222 | + this.model.traverseLeafNodes( function( node ) { |
| 223 | + node.emit( 'update' ); |
| 224 | + }, from ); |
222 | 225 | } |
223 | 226 | }; |
224 | 227 | |