Upload Attachment View - Submit form without specifying a file
Review Request #7149 — Created April 1, 2015 and submitted
Currently, if you open the modal for file uploads, you would be presented a form for uploads. Currently, the upload button is enabled, and submission is allowed without specifying a file to submit. This patch would allow set the button to disabled by default, and only enable it if a file is specified.
Manual testing was performed.
Description | From | Last Updated |
---|---|---|
These are fairly expensive queries. We should instead cache the elements in render and reference them directly. We also don't … |
chipx86 | |
These should be pseudo-private (e.g., this._$path and this._$uploadBtn, respectively). |
brennie | |
Can we give this a better name? Perhaps updateUploadButtonEnabledState? |
brennie | |
Could you condense the body of this to to: this._$uploadBtn.enable(this._$path.val()); |
brennie |
- Change Summary:
-
Removed white space.
- Commit:
-
bd5a2fbff0fc28fcff3d0297fd893f37f7fd1e47242ea429d73f07132908bf82775b723162ddf88d
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/uploadAttachmentView.js Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/uploadAttachmentView.js
- Change Summary:
-
Changed the JQuery look ups to use IDs instead of properties. These look ups cached into elements for later recalls.
- Commit:
-
242ea429d73f07132908bf82775b723162ddf88dec4af1d80885306eff5e2178353895a50fa8cb5b
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/uploadAttachmentView.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/uploadAttachmentView.js
- Change Summary:
-
Updated the naming to match a more private variable feel, and better naming convention.
Also changed the check for enabling the upload button to be 1 line (the function
updateUploadButtonEnabledState
). - Commit:
-
ec4af1d80885306eff5e2178353895a50fa8cb5b495631806bc638b32542106a909c96e4d0f78b22