Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#20561 closed enhancement (fixed)

Accelerating some js calls, and changing the check-point for another.

Reported by: georgestephanis's profile georgestephanis Owned by: azaozz's profile azaozz
Milestone: 3.4 Priority: normal
Severity: minor Version:
Component: General Keywords: needs-patch
Focuses: Cc:

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)

20561.diff (748 bytes) - added by georgestephanis 12 years ago.
20561-2.patch (936 bytes) - added by azaozz 12 years ago.

Download all attachments as: .zip

Change History (8)

#1 @scribu
12 years ago

Instead of dropping down to raw JS, why not cache it in a variable at the beginning? It's not like it will change.

#2 @georgestephanis
12 years ago

I didn't want to add another global variable to check.

#3 @scribu
12 years ago

  • Keywords needs-patch added; has-patch removed
  1. It doesn't need to be global; just move it up one level in scope
  2. It should be faster than executing a .match() every time
Last edited 12 years ago by scribu (previous) (diff)

#4 @azaozz
12 years 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?

@azaozz
12 years ago

#5 @azaozz
12 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In [20677]:

Move the check for body.mobile in postbox.js to a variable as it's used in more than one place, props georgestephanis, scribu, fixes #20561

#6 @azaozz
12 years ago

  • Milestone changed from Awaiting Review to 3.4
Note: See TracTickets for help on using tickets.