From 5085f47552e7c265a37f9fc0e5b3413154f902f0 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 14 Sep 2021 15:19:21 +0200 Subject: [PATCH 1/1] Selection fixes. --- src/redakcja/static/js/wiki/view_editor_wysiwyg.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js index 7b4069cd..7baa00da 100644 --- a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js +++ b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js @@ -727,14 +727,6 @@ var htmlView = $('#html-view'); htmlView.html(element); - htmlView.find('*[x-node]').dblclick(function(e) { - if($(e.target).is('textarea')) - return; - var selection = window.getSelection(); - selection.collapseToStart(); - selection.modify('extend', 'forward', 'word'); - e.stopPropagation(); - }); _finalize(success); }, error: function(text, source){ @@ -784,7 +776,7 @@ let selection = window.getSelection(); var n = selection.rangeCount; - if (n != 1) { + if (n != 1 || selection.isCollapsed) { window.alert("Nie zaznaczono obszaru"); return false } -- 2.20.1