@@ -228,13 +228,6 @@ export class ReaderEventService {
|
|||||||
this.handleTouchEnd(event, doc);
|
this.handleTouchEnd(event, doc);
|
||||||
}, {passive: false});
|
}, {passive: false});
|
||||||
|
|
||||||
doc.addEventListener('contextmenu', (event: MouseEvent) => {
|
|
||||||
const selection = doc.defaultView?.getSelection();
|
|
||||||
if (selection && !selection.isCollapsed) {
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
doc.addEventListener('selectionchange', () => {
|
doc.addEventListener('selectionchange', () => {
|
||||||
this.handleSelectionChange(doc);
|
this.handleSelectionChange(doc);
|
||||||
});
|
});
|
||||||
|
|||||||
+4
@@ -107,6 +107,10 @@ export class ReaderSelectionService {
|
|||||||
|
|
||||||
if (action.type === 'select') {
|
if (action.type === 'select') {
|
||||||
this.clearPreview();
|
this.clearPreview();
|
||||||
|
if (this.currentSelection?.text) {
|
||||||
|
navigator.clipboard.writeText(this.currentSelection.text);
|
||||||
|
}
|
||||||
|
this.viewManager.clearSelection();
|
||||||
this.emitState();
|
this.emitState();
|
||||||
} else if (action.type === 'search' && action.searchText) {
|
} else if (action.type === 'search' && action.searchText) {
|
||||||
this.clearPreview();
|
this.clearPreview();
|
||||||
|
|||||||
Reference in New Issue
Block a user