0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 05:00:13 -05:00

Fix selection lost on action in Presto

This commit is contained in:
Neil Jenkins 2014-12-26 20:01:36 +07:00
parent 54b428aaa6
commit 797dbf46fb
3 changed files with 9 additions and 3 deletions

View file

@ -1413,7 +1413,10 @@ proto.focus = function () {
// FF seems to need the body to be focussed (at least on first load). // FF seems to need the body to be focussed (at least on first load).
// Chrome also now needs body to be focussed in order to show the cursor // Chrome also now needs body to be focussed in order to show the cursor
// (otherwise it is focussed, but the cursor doesn't appear). // (otherwise it is focussed, but the cursor doesn't appear).
this._body.focus(); // Opera (Presto-variant) however will lose the selection if you call this!
if ( !isPresto ) {
this._body.focus();
}
this._win.focus(); this._win.focus();
return this; return this;
}; };

File diff suppressed because one or more lines are too long

View file

@ -337,7 +337,10 @@ proto.focus = function () {
// FF seems to need the body to be focussed (at least on first load). // FF seems to need the body to be focussed (at least on first load).
// Chrome also now needs body to be focussed in order to show the cursor // Chrome also now needs body to be focussed in order to show the cursor
// (otherwise it is focussed, but the cursor doesn't appear). // (otherwise it is focussed, but the cursor doesn't appear).
this._body.focus(); // Opera (Presto-variant) however will lose the selection if you call this!
if ( !isPresto ) {
this._body.focus();
}
this._win.focus(); this._win.focus();
return this; return this;
}; };