summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/tinymce/themes/advanced/js/anchor.js
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/js/tinymce/themes/advanced/js/anchor.js')
-rw-r--r--wp-includes/js/tinymce/themes/advanced/js/anchor.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/wp-includes/js/tinymce/themes/advanced/js/anchor.js b/wp-includes/js/tinymce/themes/advanced/js/anchor.js
index f1d01ea..76f4f7d 100644
--- a/wp-includes/js/tinymce/themes/advanced/js/anchor.js
+++ b/wp-includes/js/tinymce/themes/advanced/js/anchor.js
@@ -8,8 +8,10 @@ var AnchorDialog = {
elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG');
v = ed.dom.getAttrib(elm, 'name');
- if (v)
+ if (v) {
+ this.action = 'update';
f.anchorName.value = v;
+ }
f.insert.value = ed.getLang(elm ? 'update' : 'insert');
},
@@ -18,7 +20,9 @@ var AnchorDialog = {
var ed = this.editor;
tinyMCEPopup.restoreSelection();
- ed.selection.collapse(1);
+
+ if (this.action != 'update')
+ ed.selection.collapse(1);
// Webkit acts weird if empty inline element is inserted so we need to use a image instead
if (tinymce.isWebKit)