Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#21005 closed defect (bug) (fixed)

Mobile postboxes don't respect global or user preferences

Reported by: tbuteler Owned by: azaozz
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.3
Component: General Keywords:
Focuses: Cc:


I noticed there's a function in postbox.dev.js, on line 159, called _pb_change. It adjusts the number of columns on a page with metaboxes according to a mobile device's orientation. But since everything is hardcoded for 1 or 2 columns, all the work that went into allowing different number of columns for the user to choose, or even filtering those options via PHP and limiting their choice (I'm forcing 1 columns for all users, for instance), seems lost.

Maybe I'm missing something, but it seems pretty straightforward, even for my limited JS knowledge.

Attachments (1)

21005.patch (742 bytes) - added by azaozz 3 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 @johnbillion3 years ago

  • Cc johnbillion added

comment:2 @azaozz3 years ago

  • Owner set to azaozz
  • Status changed from new to reviewing

If I understand correctly the bug is that _pb_change() overrides your forcing of only one column of postboxes? Not sure what that has to do with reducing the number of available columns on narrower screens, the postboxes overlap and make the screen look pretty bad.

@azaozz3 years ago

comment:3 @azaozz3 years ago

  • Keywords reporter-feedback added

Could you confirm if 21005.patch fixes the bug.

comment:4 @tbuteler3 years ago

  • Keywords reporter-feedback removed

The patch fixes the bug, yes. Looking up the selected checkbox is a very clever solution...

comment:5 @nacin3 years ago

  • Milestone changed from Awaiting Review to 3.5
  • Version changed from 3.4 to 3.3

This code was in 3.3 ([18926]) so setting version, and assigning to 3.5. Good to go, azaozz.

comment:6 @azaozz3 years ago

Clever, but not clever enough :) It needs to check the first radio button, not the second. If the user has selected 3 or 4 columns, it should switch to two when going to landscape.

comment:7 @azaozz3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In [21091]:

Respect user settings when auto-switching postbox columns on mobile devices, fixes #21005

comment:8 follow-up: @nacin3 years ago

If the user has selected 3 or 4 columns, it should switch to two when going to landscape.

Do you mean it should *not* switch to two when going to landscape?

comment:9 in reply to: ↑ 8 @azaozz3 years ago

Replying to nacin:

Do you mean it should *not* switch to two when going to landscape?

Ugh, sry for not being clear. It wasn't switching to two with the above patch, fixed in the committed one.

The problem was that the JS used to switch one to two columns when rotating a mobile device wasn't looking at the user setting, i.e. was switching to two columns even when only one column was selected. The first patch was testing the wrong radio button, resulting in not switching when 3 or 4 columns were selected too.

Note: See TracTickets for help on using tickets.