#20561 closed enhancement (fixed)
Accelerating some js calls, and changing the check-point for another.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | General | Version: | |
| Severity: | minor | Keywords: | needs-patch |
| Cc: | georgestephanis |
Description
First change in the patch falls back from using jQuery to pure JS -- should be much quicker as it'll be loading frequently.
Second change lets us base it off of how the back-end calculates mobile, rather than just 'mobile' in the UA string. Should converge them to one test point, rather than dispersed ones.
Attachments (2)
Change History (8)
georgestephanis
— 14 months ago
comment:2
georgestephanis
— 14 months ago
I didn't want to add another global variable to check.
comment:3
scribu
— 14 months ago
- Keywords needs-patch added; has-patch removed
- It doesn't need to be global; just move it up one level in scope
- It should be faster than executing a .match() every time
comment:4
azaozz
— 14 months ago
jQuery seems to cache the selectors anyways, not sure if this would make any difference. On the other hand it's a good practice to set things like this to a variable instead of running it every time.
BTW isn't this a duplicate of #20557?
Instead of dropping down to raw JS, why not cache it in a variable at the beginning? It's not like it will change.