We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents db907e5 + 9c08cf0 commit 0213b32Copy full SHA for 0213b32
src/plugins/plugin.text_selection.js
@@ -82,6 +82,22 @@ export class TextSelectionPlugin extends BookReaderPlugin {
82
$(window.getSelection().anchorNode).closest('.BRpagecontainer').addClass('BRpagecontainer--hasSelection');
83
}
84
}).attach();
85
+
86
+ if (this.br.protected) {
87
+ // Prevent right clicking when selected text
88
+ $(document.body).on('contextmenu dragstart copy', (e) => {
89
+ const selection = document.getSelection();
90
+ if (selection?.toString()) {
91
+ const intersectsTextLayer = $('.BRtextLayer')
92
+ .toArray()
93
+ .some(el => selection.containsNode(el, true));
94
+ if (intersectsTextLayer) {
95
+ e.preventDefault();
96
+ return false;
97
+ }
98
99
+ });
100
101
102
103
/**
0 commit comments