Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | _this.onPaste( e ); |
52 | 52 | } ) |
53 | 53 | .on( 'mousedown', function( e ) { |
54 | | - // return _this.onMouseDown( e ); |
| 54 | + return _this.onMouseDown( e ); |
55 | 55 | } ) |
56 | 56 | .on( 'compositionstart', function( e ) { |
57 | 57 | console.log('comp start'); |
— | — | @@ -275,7 +275,20 @@ |
276 | 276 | this.poll.prevOffset = localOffset; |
277 | 277 | }; |
278 | 278 | |
| 279 | +ve.es.Surface.prototype.onMouseDown = function( e ) { |
| 280 | + if ( this.poll.interval !== null ) { |
| 281 | + this.stopPolling(); |
| 282 | + this.pollContent(); |
| 283 | + this.startPolling(); |
| 284 | + } |
| 285 | +}; |
| 286 | + |
279 | 287 | ve.es.Surface.prototype.onKeyDown = function( e ) { |
| 288 | + if ( this.poll.interval !== null ) { |
| 289 | + this.stopPolling(); |
| 290 | + this.pollContent(); |
| 291 | + this.startPolling(); |
| 292 | + } |
280 | 293 | switch ( e.keyCode ) { |
281 | 294 | // Enter |
282 | 295 | case 13: |
— | — | @@ -321,12 +334,10 @@ |
322 | 335 | } |
323 | 336 | break; |
324 | 337 | } |
325 | | - /* |
326 | 338 | var range = this.getSelection(); |
327 | 339 | if ( range.getLength() !== 0 ) { |
328 | 340 | e.preventDefault(); |
329 | 341 | } |
330 | | - */ |
331 | 342 | }; |
332 | 343 | |
333 | 344 | ve.es.Surface.prototype.getOffset = function( elem, offset, global ) { |