0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Fix IE8 grabs focus on load of editor.

This commit is contained in:
Neil Jenkins 2012-04-04 17:01:28 +10:00
parent c595fb0bb8
commit 63a97d9b99

View file

@ -22,6 +22,7 @@
// Browser sniffing. Unfortunately necessary.
var isOpera = !!win.opera;
var isIE = !!win.ie;
var isIE8 = win.ie === 8;
var isGecko = /Gecko\//.test( navigator.userAgent );
var isWebKit = /WebKit/.test( navigator.userAgent );
var isIOS = /iP(?:ad|hone|od)/.test( navigator.userAgent );
@ -1636,7 +1637,13 @@
// Record undo state
var range = createRange( body.firstChild, 0 );
recordUndoState( range );
setSelection( getRangeAndRemoveBookmark( range ) );
getRangeAndRemoveBookmark( range );
// IE8 will also set focus when selecting text.
// It doesn't make any difference since it doesn't
// maintain selection when not focussed anyway.
if ( !isIE8 ) {
setSelection( range );
}
updatePath( range, true );
return this;