зеркало из https://github.com/mozilla/pjs.git
Fixed OK button enabling for Link Properties, part of 47653, r=sfraser
This commit is contained in:
Родитель
84f503f0fc
Коммит
dc4ae20929
|
@ -72,6 +72,7 @@ function Startup()
|
||||||
|
|
||||||
// See if we have a single selected image
|
// See if we have a single selected image
|
||||||
imageElement = editorShell.GetSelectedElement("img");
|
imageElement = editorShell.GetSelectedElement("img");
|
||||||
|
|
||||||
if (imageElement)
|
if (imageElement)
|
||||||
{
|
{
|
||||||
// Get the parent link if it exists -- more efficient than GetSelectedElement()
|
// Get the parent link if it exists -- more efficient than GetSelectedElement()
|
||||||
|
@ -153,8 +154,7 @@ function Startup()
|
||||||
{
|
{
|
||||||
if (!imageElement)
|
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
|
// Check if selection has some text - use that first
|
||||||
selectedText = GetSelectionAsText();
|
selectedText = GetSelectionAsText();
|
||||||
if (selectedText.length == 0)
|
if (selectedText.length == 0)
|
||||||
|
@ -165,7 +165,8 @@ function Startup()
|
||||||
{
|
{
|
||||||
for(i=0; i < children.length; i++)
|
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);
|
imageElement = children.item(i);
|
||||||
break;
|
break;
|
||||||
|
@ -235,6 +236,8 @@ function chooseFile()
|
||||||
fileName = GetLocalFileURL("html");
|
fileName = GetLocalFileURL("html");
|
||||||
if (fileName) {
|
if (fileName) {
|
||||||
dialog.hrefInput.value = fileName;
|
dialog.hrefInput.value = fileName;
|
||||||
|
// Call this to do OK button enabling
|
||||||
|
ChangeText();
|
||||||
}
|
}
|
||||||
// Put focus into the input field
|
// Put focus into the input field
|
||||||
SetTextfieldFocus(dialog.hrefInput);
|
SetTextfieldFocus(dialog.hrefInput);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче