[wp-trac] [WordPress Trac] #47069: The admin bar on the front end has reduced functionality and bugs when jQuery not being used
WordPress Trac
noreply at wordpress.org
Wed Dec 11 17:13:56 UTC 2019
#47069: The admin bar on the front end has reduced functionality and bugs when
jQuery not being used
-------------------------------------+-------------------------------------
Reporter: afercia | Owner: audrasjb
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 5.3.1
Component: Toolbar | Version: 5.0
Severity: normal | Resolution:
Keywords: has-screenshots early | Focuses: accessibility,
has-patch 2nd-opinion needs- | javascript
testing |
-------------------------------------+-------------------------------------
Comment (by azaozz):
Replying to [comment:76 dinhtungdu]:
> @azaozz It's 9 am here so it's no problem :D. The patch works great for
me. I have some questions about the code:
Ah, that's great! :)
> Why do we need to check for `window.Element` exist or not?
Yeah, probably not needed especially after it tests for `querySelectorAll`
at the top (added it mostly for completeness after looking at the (big)
compatibility table at https://developer.mozilla.org/en-
US/docs/Web/API/Element).
> The indentation of some functions is too deep for me, should we try to
fix them with early return style?
Sure, lets reduce it. Removing the `window.Element` check and returning
early in few functions should reduce indentation :)
Patch coming up.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47069#comment:78>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list