mirror of
https://github.com/zotero/zotero.git
synced 2026-10-03 02:21:49 +00:00
Properly focus reader iframe when opening a new reader instance
This commit is contained in:
parent
3ef1f09927
commit
b05ef8ed04
1 changed files with 6 additions and 1 deletions
|
|
@ -86,6 +86,11 @@ class ReaderInstance {
|
|||
return this._type;
|
||||
}
|
||||
|
||||
async focus() {
|
||||
await this._waitForReader();
|
||||
this._iframeWindow.focus();
|
||||
}
|
||||
|
||||
getSecondViewState() {
|
||||
let state = this._iframeWindow.wrappedJSObject.getSecondViewState();
|
||||
return state ? JSON.parse(JSON.stringify(state)) : undefined;
|
||||
|
|
@ -1441,7 +1446,7 @@ class Reader {
|
|||
}
|
||||
|
||||
if (!openInBackground) {
|
||||
reader._window.focus();
|
||||
reader.focus();
|
||||
}
|
||||
return reader;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue