Fixing up initial enabling of the OK button when saving files. r=timeless, sr=blake,

git-svn-id: svn://10.0.0.236/trunk@107298 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%netscape.com 2001-11-05 00:07:38 +00:00
parent 89157f0cca
commit 57b929e4bf

View File

@ -96,6 +96,7 @@ function filepickerLoad() {
// start out with a filename sort
handleColumnClick("FilenameColumn");
document.documentElement.setAttribute("ondialogcancel", "onCancel");
try {
var buttonLabel = getOKAction();
okButton.setAttribute("label", buttonLabel);
@ -412,11 +413,11 @@ function getOKAction(file) {
var buttonLabel;
if (file && file.isDirectory() && filePickerMode != nsIFilePicker.modeGetFolder) {
doSetOKCancel(openOnOK, onCancel);
document.documentElement.setAttribute("ondialogaccept", "openOnOK");
buttonLabel = gFilePickerBundle.getString("openButtonLabel");
}
else {
doSetOKCancel(selectOnOK, onCancel);
document.documentElement.setAttribute("ondialogaccept", "selectOnOK");
switch(filePickerMode) {
case nsIFilePicker.modeGetFolder:
buttonLabel = gFilePickerBundle.getString("selectFolderButtonLabel");