[wp-trac] [WordPress Trac] #20855: Don't show Upload button until file has been selected.
WordPress Trac
noreply at wordpress.org
Thu Nov 15 06:35:18 UTC 2012
#20855: Don't show Upload button until file has been selected.
------------------------------+------------------------
Reporter: jane | Owner: kovshenin
Type: task (blessed) | Status: reopened
Priority: normal | Milestone: 3.5
Component: UI | Version: 3.4
Severity: minor | Resolution:
Keywords: has-patch commit |
------------------------------+------------------------
Comment (by kovshenin):
Replying to [comment:38 SergeyBiryukov]:
Oh, that's true, gotcha! [attachment:20855.12.diff] looks reasonable and
works in this case, but I think it's pretty fragile, since it will break
if there's any other element between the file input and the submit button,
because of the way .prev() works. The media upload form has two file
inputs, and two submit buttons, which makes me think: what if they were
all visible? :)
We can concatenate all the file input values with .map and check for an
empty string. That will enable all submit buttons in a form if at least
one file input has a value, which sounds like it could break less.
Besides, we'd rather "not disable the submit button when we need to" than
"not enable the submit button when we need to." Thoughts?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20855#comment:39>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list