diff --git a/mozilla/editor/ui/dialogs/content/EdDialogTemplate.js b/mozilla/editor/ui/dialogs/content/EdDialogTemplate.js index 6f4ab3e6476..4d591256539 100644 --- a/mozilla/editor/ui/dialogs/content/EdDialogTemplate.js +++ b/mozilla/editor/ui/dialogs/content/EdDialogTemplate.js @@ -1,7 +1,6 @@ //Cancel() is in EdDialogCommon.js var editorShell; var insertNew = true; -var inserted = false; var tagname = "TAG NAME" // dialog initialization code @@ -56,18 +55,7 @@ function onOK() // Set attribute example: // imageElement.setAttribute("src",dialog.srcInput.value); if (insertNew) { - editorShell.InsertElement(element, true); - // Select the newly-inserted image - editorShell.SelectElement(element); - // Mark that we inserted so we can collapse the selection - // when dialog closes - inserted = true; - } - - if (inserted) { - // We selected the object, undo it by - // setting caret to just after the inserted element - editorShell.SetSelectionAfterElement(imageElement); + editorShell.InsertElement(element, false); } window.close(); } diff --git a/mozilla/editor/ui/dialogs/content/EdImageProps.js b/mozilla/editor/ui/dialogs/content/EdImageProps.js index ef7270bb60a..15243860449 100644 --- a/mozilla/editor/ui/dialogs/content/EdImageProps.js +++ b/mozilla/editor/ui/dialogs/content/EdImageProps.js @@ -316,15 +316,7 @@ function onOK() // handle insertion of new image if (insertNew) { dump("src="+imageElement.getAttribute("src")+" alt="+imageElement.getAttribute("alt")+"\n"); - editorShell.InsertElement(imageElement, true); - // Select the newly-inserted image - editorShell.SelectElement(imageElement); - // Mark that we inserted so we can collapse the selection - // when dialog closes - - // We selected the object, undo it by - // setting caret to just after the inserted element - editorShell.SetSelectionAfterElement(imageElement); + editorShell.InsertElement(imageElement, false); } // dismiss dialog diff --git a/mozilla/editor/ui/dialogs/content/EdLinkProps.js b/mozilla/editor/ui/dialogs/content/EdLinkProps.js index d47bd4b2ddb..cc91beb94d4 100644 --- a/mozilla/editor/ui/dialogs/content/EdLinkProps.js +++ b/mozilla/editor/ui/dialogs/content/EdLinkProps.js @@ -170,7 +170,7 @@ function onOK() anchorElement.appendChild(textNode); } dump("Inserting\n"); - editorShell.InsertElement(anchorElement, true); + editorShell.InsertElement(anchorElement, false); } else if (insertLinkAroundSelection) { dump("Setting link around selected text\n"); editorShell.InsertLinkAroundSelection(anchorElement); diff --git a/mozilla/editor/ui/dialogs/content/EdNamedAnchorProps.js b/mozilla/editor/ui/dialogs/content/EdNamedAnchorProps.js index 6d5677d0922..ae9144a1595 100644 --- a/mozilla/editor/ui/dialogs/content/EdNamedAnchorProps.js +++ b/mozilla/editor/ui/dialogs/content/EdNamedAnchorProps.js @@ -1,7 +1,6 @@ //Cancel() is in EdDialogCommon.js var editorShell; var insertNew = true; -var inserted = false; var tagName = "anchor" var anchorElement = null; @@ -65,21 +64,10 @@ function onOK() } else { // Replace spaces with "_" else it causes trouble in URL parsing name = ReplaceWhitespace(name, "_"); - imageElement.setAttribute("name",name); + anchorElement.setAttribute("name",name); if (insertNew) { // Don't delete selected text when inserting editorShell.InsertElement(element, false); - // Select the newly-inserted image - editorShell.SelectElement(element); - // Mark that we inserted so we can collapse the selection - // when dialog closes - inserted = true; - } - - if (inserted) { - // We selected the object, undo it by - // setting caret to just after the inserted element - editorShell.SetSelectionAfterElement(imageElement); } window.close(); }