Fixes #1542
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 22 Mar 2013 08:32:53 +0000 (09:32 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 22 Mar 2013 08:32:53 +0000 (09:32 +0100)
redakcja/static/js/wiki/view_editor_wysiwyg.js

index 01deb58..da69d3e 100644 (file)
         xml2html({
             xml: this.doc.text,
             success: function(element){
         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){
                 _finalize(success);
             },
             error: function(text, source){