[wp-trac] [WordPress Trac] #27403: Improve UI for linking areas of Customizer preview to corresponding controls (desktop and mobile)

WordPress Trac noreply at wordpress.org
Wed Oct 12 00:32:59 UTC 2016


#27403: Improve UI for linking areas of Customizer preview to corresponding
controls (desktop and mobile)
-------------------------+-----------------------------
 Reporter:  westonruter  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Customize    |     Version:  3.9
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  ui, javascript
-------------------------+-----------------------------

Comment (by sirbrillig):

 When I call `partial.showControl()` on a menu, it sends the following
 event to the parent frame:

 `api.preview.send('focus-control-for-setting',
 'nav_menu_instance[0e6e681bc81cb296f5497e1fe9fb9d23]')`

 It appears that `'nav_menu_instance[...]` does not map to a panel in the
 sidebar. I notice that the panels I can focus with that event have a
 `data-customize-setting-link` property, but menu panels don't appear to
 have that anywhere I can see.

 How does shift-clicking on a menu work?

 `api.preview.send( 'focus-nav-menu-item-control', menuItem );`

 In that case, `menuItem` is an integer for a specific menu item, but it
 looks like maybe there's no way to focus a menu itself.

 If that's true (@celloexpressions ?) then I suppose there's a few options:

 - We could extend `showControl()` to notice when it's targeting a menu,
 try to find an integer for the menu's first item, and send that to the
 `focus-nav-menu-item-control` event. That seems like a hack, though.
 - We could modify the handler for `focus-control-for-setting` to accept
 menu hashes like the one above and somehow find the menu panel that the
 hash applies to. This is more sensible, but it's quite a lot of pieces I'm
 not familiar with.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27403#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list