editor: plugins/core - better selecton restore after undoing/redoing link edition...
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 13 May 2014 10:41:22 +0000 (12:41 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 13 May 2014 10:41:22 +0000 (12:41 +0200)
src/editor/plugins/core/links/linkElement.js

index 8d280c7..ceefee1 100644 (file)
@@ -63,7 +63,7 @@ _.extend(linkElement, {
             }, {
                 metadata: {
                     description: gettext('Edit link'),
             }, {
                 metadata: {
                     description: gettext('Edit link'),
-                    fragment: doc.createFragment(doc.CaretFragment, {node: el.wlxmlNode.contents()[0], offset:0})
+                    fragment: doc.createFragment(doc.CaretFragment, {node: el.wlxmlNode.contents()[0], offset:offset})
                 },
                 success: function() {
                     el.canvas.select(doc.createFragment(doc.CaretFragment, {node: el.wlxmlNode.contents()[0], offset:offset}));
                 },
                 success: function() {
                     el.canvas.select(doc.createFragment(doc.CaretFragment, {node: el.wlxmlNode.contents()[0], offset:offset}));