[wp-trac] [WordPress Trac] #39516: Media grid upload errors display below the grid.
WordPress Trac
noreply at wordpress.org
Wed Feb 1 17:23:28 UTC 2017
#39516: Media grid upload errors display below the grid.
------------------------------+--------------------------------------------
Reporter: joemcgill | Owner: afercia
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.7.3
Component: Media | Version: 4.6
Severity: normal | Resolution:
Keywords: has-patch needs- | Focuses: ui, accessibility, javascript
testing |
------------------------------+--------------------------------------------
Comment (by afercia):
I'd propose a slightly different approach, see refreshed patch.
Looking at the doc description for `[options.sidebar=true]`, it `Accepts
true, false, and 'errors'`. By default it's true and, as far as I see, it
is set to `'errors'` just once, for the media grid.
In the previous approach instead, the model id can have several values.
Basically checking for the 'options.sidebar' value should be more reliable
and the same check is already used a few lines below in `browser.js`.
Also, I'd propose to avoid nested `if`s.
Worth mentioning the code could be simplified a bit, for example the
multiple checks for `'errors' === this.options.sidebar` could be avoided
maybe, and the CSS classes could be set in just one go. But I didn't want
to touch anything else ;)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39516#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list