Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js |
— | — | @@ -157,6 +157,7 @@ |
158 | 158 | |
159 | 159 | // Configuration |
160 | 160 | this.mac = navigator.userAgent.match(/mac/i) ? true : false; // (yes it's evil, for keys only!) |
| 161 | + this.ie8 = $.browser.msie && $.browser.version === "8.0"; |
161 | 162 | |
162 | 163 | // Initialization |
163 | 164 | this.$input.focus(); |
— | — | @@ -325,7 +326,7 @@ |
326 | 327 | var selection = this.currentSelection.clone(), |
327 | 328 | offset = this.documentView.getOffsetFromEvent( e ); |
328 | 329 | // Single click |
329 | | - if ( e.originalEvent.detail === 1 ) { |
| 330 | + if ( this.ie8 || e.originalEvent.detail === 1 ) { |
330 | 331 | // @see {es.SurfaceView.prototype.onMouseMove} |
331 | 332 | this.mouse.selectingMode = 1; |
332 | 333 | |
— | — | @@ -365,15 +366,30 @@ |
366 | 367 | ); |
367 | 368 | this.mouse.selectedRange = selection.clone(); |
368 | 369 | } |
369 | | - // Reset the initial left position |
370 | | - this.cursor.initialLeft = null; |
371 | | - // Apply new selection |
372 | | - this.model.select( selection, true ); |
373 | 370 | } |
374 | | - // If the inut isn't already focused, focus it and select it's contents |
375 | | - if ( !this.$input.is( ':focus' ) ) { |
376 | | - this.$input.focus().select(); |
| 371 | + |
| 372 | + var _this = this; |
| 373 | + |
| 374 | + function select() { |
| 375 | + if ( e.which === 1 ) { |
| 376 | + // Reset the initial left position |
| 377 | + _this.cursor.initialLeft = null; |
| 378 | + // Apply new selection |
| 379 | + _this.model.select( selection, true ); |
| 380 | + } |
| 381 | + |
| 382 | + // If the inut isn't already focused, focus it and select it's contents |
| 383 | + if ( !_this.$input.is( ':focus' ) ) { |
| 384 | + _this.$input.focus().select(); |
| 385 | + } |
377 | 386 | } |
| 387 | + |
| 388 | + if ( this.ie8 ) { |
| 389 | + setTimeout( select, 0 ); |
| 390 | + } else { |
| 391 | + select(); |
| 392 | + } |
| 393 | + |
378 | 394 | return false; |
379 | 395 | }; |
380 | 396 | |