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:
parent
52b92abe47
commit
fc39c13916
3 changed files with 14 additions and 6 deletions
|
@ -2942,8 +2942,12 @@ function enableRestoreSelection () {
|
||||||
function disableRestoreSelection () {
|
function disableRestoreSelection () {
|
||||||
this._restoreSelection = false;
|
this._restoreSelection = false;
|
||||||
}
|
}
|
||||||
function restoreSelection () {
|
function restoreSelection (event) {
|
||||||
if ( this._restoreSelection ) {
|
if ( this._restoreSelection && (
|
||||||
|
event == undefined
|
||||||
|
|| event.relatedTarget === null
|
||||||
|
|| !isOrContains(this._root, event.relatedTarget))
|
||||||
|
) {
|
||||||
this.setSelection( this._lastSelection );
|
this.setSelection( this._lastSelection );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -495,8 +495,12 @@ function enableRestoreSelection () {
|
||||||
function disableRestoreSelection () {
|
function disableRestoreSelection () {
|
||||||
this._restoreSelection = false;
|
this._restoreSelection = false;
|
||||||
}
|
}
|
||||||
function restoreSelection () {
|
function restoreSelection (event) {
|
||||||
if ( this._restoreSelection ) {
|
if ( this._restoreSelection && (
|
||||||
|
event == undefined
|
||||||
|
|| event.relatedTarget === null
|
||||||
|
|| !isOrContains(this._root, event.relatedTarget))
|
||||||
|
) {
|
||||||
this.setSelection( this._lastSelection );
|
this.setSelection( this._lastSelection );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue