Closed Bug 52188 Opened 24 years ago Closed 24 years ago

Disable/enable Open/Save/Select when appropriate

Categories

(Core :: XUL, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jag+mozbugs, Assigned: jag+mozbugs)

References

Details

Attachments

(2 files)

Currently you can click on Open/Save/Select in the xp filepicker when it shouldn't do anything, for example when nothing is selected and nothing's in the textfield. Working on a patch.
Have the patch, waiting for r=
Status: NEW → ASSIGNED
Blocks: 24731
adding keywords
Keywords: patch, review
r=Pavlov
Keywords: reviewapproval
+function doEnabling() { + var enable = false; + + // Maybe add check if textInput.value would resolve to an existing + // file or directory in .modeOpen. Too costly I think. + if (textInput.value!="") { + enable = true; + } How about // Maybe add check if textInput.value would resolve to an existing // file or directory in .modeOpen. Too costly I think. var enable = (textInput.value != ""); Faster, shorter, etc. + + if (enable) { + if (okButton.getAttribute("disabled")) { + okButton.removeAttribute("disabled"); + } + } else { + if (!okButton.getAttribute("disabled")) { + okButton.setAttribute("disabled","true"); + } + } +} Is there an XXX symlink comment a la the one in bug 51118's patch that should go near the isFile() test in this bug's patch (later, not quoted above)? /be
Nope, not needed, see bug 51118.
r=pavlov
Fix checked in on trunk, marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Keywords: approval
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: