[wp-trac] [WordPress Trac] #20614: Making the menus work in Windows Phone 7, and work better in Android / iOS

WordPress Trac wp-trac at lists.automattic.com
Thu May 17 05:42:32 UTC 2012


#20614: Making the menus work in Windows Phone 7, and work better in Android / iOS
-----------------------------------------+------------------------------
 Reporter:  georgestephanis              |       Owner:
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Toolbar                      |     Version:  3.4
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch tableteers mobile  |
-----------------------------------------+------------------------------

Comment (by azaozz):

 Imho the best way to do this is to use "states" on the links when on a
 mobile device. The JS would be similar to the patch above and use an
 additional class on the link to keep its "state". The first click (or
 touch, or tap) would open the submenu if any and the second will follow
 the link:

 {{{
 ( if is_mobile )

 $('#wpcontent').bind('click.adminbar-mobile', function(e){
   var target = $( e.target );

   if ( target.parent().parent().hasClass('ab-top-menu') ) {
     // target is top level toolbar menu item
     if ( target.hasClass('touched') ) {
       return true; // follow the link
     } else {
       target.addClass('touched');
       target.parent().addClass('hover');
       e.preventDefault();
     }
   } else if ( target.hasClass('wp-menu-image') || target.hasClass('menu-
 top') ) {
     // target is top level admin menu item
     ...
   }
 });
 }}}

 Will make a full patch probably tomorrow.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20614#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list