Bug 294987 - "In <EdColorPicker.xul>, "Warning: Error in parsing value for property 'background-color'. Declaration dropped.", with empty |Last*Color|" ((Av1b) <EdColorPicker.js>) [p=sgautherie.bz@free.fr (Serge Gautherie) r+sr=Neil]

This commit is contained in:
reed@reedloden.com 2008-04-04 02:09:46 -07:00
Родитель 5419c76caa
Коммит 961ee94f8e
1 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -167,16 +167,21 @@ function Startup()
gColorObj.LastBackgroundColor = gDialog.LastPickedColor.getAttribute("LastBackgroundColor");
LastPickedColor = gColorObj.LastBackgroundColor;
}
gDialog.LastPickedColor.setAttribute("style","background-color: "+LastPickedColor);
// Set method to detect clicking on OK button
// so we don't get fooled by changing "default" behavior
gDialog.Ok.setAttribute("onclick", "SetDefaultToOk()");
// Make the "Last-picked" the default button
// until the user selects a color
if (!LastPickedColor) {
// Hide the button, as there is no last color available.
gDialog.LastPickedButton.hidden = true;
} else {
gDialog.LastPickedColor.setAttribute("style", "background-color: " + LastPickedColor);
// Make "Last-picked" the default button, until the user selects a color.
gDialog.Ok.removeAttribute("default");
gDialog.LastPickedButton.setAttribute("default", "true");
}
// Caller can prevent user from submitting an empty, i.e., default color
NoDefault = gColorObj.NoDefault;