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

Allows images and other elements within the editor to be focused.

This commit is contained in:
Robert O'Leary 2017-02-13 13:15:00 +01:00
parent 52b92abe47
commit fc39c13916
No known key found for this signature in database
GPG key ID: DD07530AA9B1D961
3 changed files with 14 additions and 6 deletions

View file

@ -2942,8 +2942,12 @@ function enableRestoreSelection () {
function disableRestoreSelection () {
this._restoreSelection = false;
}
function restoreSelection () {
if ( this._restoreSelection ) {
function restoreSelection (event) {
if ( this._restoreSelection && (
event == undefined
|| event.relatedTarget === null
|| !isOrContains(this._root, event.relatedTarget))
) {
this.setSelection( this._lastSelection );
}
}

File diff suppressed because one or more lines are too long

View file

@ -495,8 +495,12 @@ function enableRestoreSelection () {
function disableRestoreSelection () {
this._restoreSelection = false;
}
function restoreSelection () {
if ( this._restoreSelection ) {
function restoreSelection (event) {
if ( this._restoreSelection && (
event == undefined
|| event.relatedTarget === null
|| !isOrContains(this._root, event.relatedTarget))
) {
this.setSelection( this._lastSelection );
}
}