Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#35533 closed defect (bug) (fixed)

Widget reorder button in Customizer shows when only one widget

Reported by: karmatosed Owned by: westonruter
Priority: normal Milestone: 4.5
Component: Customize Version: 3.9
Severity: normal Keywords: has-patch
Cc: Focuses: javascript

Description (last modified by karmatosed)

If you only have one widget the reorder button shows in the Customizer. I would suggest this should only show if more than 2 as you can't really reorder just one.

https://cldup.com/DtWDgUJtla.png

Attachments (2)

35533.diff​ (422 bytes ) - added by rabmalin 11 years ago.
35533.2.diff​ (475 bytes ) - added by westonruter 11 years ago.

Download all attachments as: .zip

Change History (7)

#1 @karmatosed
11 years ago

  • Description modified (diff)

#2 @westonruter
11 years ago

  • Focuses javascript added
  • Keywords good-first-bug added
  • Milestone Awaiting Review → 4.5
  • Version → 3.9

This was almost done in #27787 which hid the button if the widget area was empty. So the change here would be to also hide the button if there is ≤1 widget.

@rabmalin
11 years ago

#3 @rabmalin
11 years ago

  • Keywords has-patch added

Patch added.

@westonruter
11 years ago

#4 @westonruter
11 years ago

  • Keywords good-first-bug removed

I found an edge case in 35533.diff​ that wasn't accounted for. The re-ordering controls for widgets don't only handle re-ordering of widgets within a sidebar, but they also provide a link to move a widget to another sidebar. So in 35533.2.diff​ it only hides the Reorder button if there are no widgets in the sidebar or if there is only one widget and there is only one widget area.

Make sense?

#5 @westonruter
11 years ago

  • Owner set to westonruter
  • Resolution → fixed
  • Status new → closed

In 36522:

Customize: Hide widgets re-order button when no re-ordering is possible.

Hide the re-order button if there are no widgets in the sidebar, or if there is there is only one sidebar and there is only one widget in the sidebar.

Props rabmalin, westonruter.
Fixes #35533.

Note: See TracTickets for help on using tickets.