Add a work-around for mouseup events that are never triggered in reader
This commit is contained in:
parent
d1322bd4b6
commit
3736a93c2c
2 changed files with 21 additions and 1 deletions
|
@ -699,6 +699,26 @@ class ReaderTab extends ReaderInstance {
|
|||
});
|
||||
|
||||
this._iframe.setAttribute('tooltip', 'html-tooltip');
|
||||
|
||||
// This is a nonsense work-around to trigger mouseup and pointerup
|
||||
// events in PDF reader iframe when mouse up happens over another iframe
|
||||
// i.e. note-editor. There should be a better way to solve this
|
||||
this._window.addEventListener('pointerup', (event) => {
|
||||
if (this._window.Zotero_Tabs.selectedID === this.tabID
|
||||
&& event.target
|
||||
&& event.target.closest
|
||||
&& !event.target.closest('#outerContainer')) {
|
||||
let evt = new this._iframeWindow.CustomEvent('mouseup', { bubbles: false });
|
||||
evt.clientX = event.clientX;
|
||||
evt.clientY = event.clientY;
|
||||
this._iframeWindow.dispatchEvent(evt);
|
||||
|
||||
evt = new this._iframeWindow.CustomEvent('pointerup', { bubbles: false });
|
||||
evt.clientX = event.clientX;
|
||||
evt.clientY = event.clientY;
|
||||
this._iframeWindow.dispatchEvent(evt);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
close() {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a1804bbbd3c03f3984d7c5d0a5f214d7de48643c
|
||||
Subproject commit c939b9a572696f60a4334eadc2feefc155bdf7f8
|
Loading…
Add table
Reference in a new issue