From: Aleksander Ɓukasz Date: Fri, 22 Mar 2013 08:32:53 +0000 (+0100) Subject: Fixes #1542 X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/1b88bcf6c02383b99bc136ad114588fcf0666660?hp=28228fc438edfd3275ce50a90bd3f87180344036 Fixes #1542 --- diff --git a/redakcja/static/js/wiki/view_editor_wysiwyg.js b/redakcja/static/js/wiki/view_editor_wysiwyg.js index 01deb58f..da69d3eb 100644 --- a/redakcja/static/js/wiki/view_editor_wysiwyg.js +++ b/redakcja/static/js/wiki/view_editor_wysiwyg.js @@ -618,7 +618,16 @@ xml2html({ xml: this.doc.text, success: function(element){ - $('#html-view').html(element); + 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){