diff options
author | Andrew Dolgov <[email protected]> | 2021-02-20 21:07:28 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-20 21:07:28 +0300 |
commit | da97b29dbe7ac923fae5a0cddee141716d1da3e5 (patch) | |
tree | f592c51af4aac15fb0e3e6295bc0d1403c3bed58 /js/common.js | |
parent | 590b1fc39e104bd41a8ab213b98b38345dba4eac (diff) |
prevent filter selected text dialog from opening in wrong order
Diffstat (limited to 'js/common.js')
-rwxr-xr-x | js/common.js | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/js/common.js b/js/common.js index 6e8168357..01fe321f7 100755 --- a/js/common.js +++ b/js/common.js @@ -401,25 +401,3 @@ const Notify = { } }; -// http://stackoverflow.com/questions/6251937/how-to-get-selecteduser-highlighted-text-in-contenteditable-element-and-replac -/* exported getSelectionText */ -function getSelectionText() { - let text = ""; - - if (typeof window.getSelection != "undefined") { - const sel = window.getSelection(); - if (sel.rangeCount) { - const container = document.createElement("div"); - for (let i = 0, len = sel.rangeCount; i < len; ++i) { - container.appendChild(sel.getRangeAt(i).cloneContents()); - } - text = container.innerHTML; - } - } else if (typeof document.selection != "undefined") { - if (document.selection.type == "Text") { - text = document.selection.createRange().textText; - } - } - - return text.stripTags(); -} |