From dc4ae20929d8dc956dbf621c57ca67be7df68984 Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Thu, 24 Aug 2000 00:40:59 +0000 Subject: [PATCH] Fixed OK button enabling for Link Properties, part of 47653, r=sfraser --- editor/ui/dialogs/content/EdLinkProps.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/ui/dialogs/content/EdLinkProps.js b/editor/ui/dialogs/content/EdLinkProps.js index 03c2acff3fd..ac7b25c4c22 100644 --- a/editor/ui/dialogs/content/EdLinkProps.js +++ b/editor/ui/dialogs/content/EdLinkProps.js @@ -72,6 +72,7 @@ function Startup() // See if we have a single selected image imageElement = editorShell.GetSelectedElement("img"); + if (imageElement) { // Get the parent link if it exists -- more efficient than GetSelectedElement() @@ -153,8 +154,7 @@ function Startup() { if (!imageElement) { - // Don't think we can ever get here! - + // We get here if selection is exactly around a link node // Check if selection has some text - use that first selectedText = GetSelectionAsText(); if (selectedText.length == 0) @@ -165,7 +165,8 @@ function Startup() { for(i=0; i < children.length; i++) { - if (children.item(i) == "IMG") + var nodeName = children.item(i).nodeName.toLowerCase(); + if (nodeName == "img") { imageElement = children.item(i); break; @@ -235,6 +236,8 @@ function chooseFile() fileName = GetLocalFileURL("html"); if (fileName) { dialog.hrefInput.value = fileName; + // Call this to do OK button enabling + ChangeText(); } // Put focus into the input field SetTextfieldFocus(dialog.hrefInput);