Created
May 3, 2012 22:10
-
-
Save georgestephanis/2589883 to your computer and use it in GitHub Desktop.
Add support for menus to WP7 and better support to Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function($){ | |
| if( $('#wpadminbar li.menupop').size() ){ | |
| $('#wpadminbar li.menupop').click(function(e){ | |
| if( ! $(this).hasClass('hover') ){ | |
| $('#wpadminbar li.menupop.hover').removeClass('hover'); | |
| $(this).addClass('hover'); | |
| e.preventDefault(); | |
| return; | |
| } | |
| }); | |
| $(document).bind('click', function(e) { | |
| if( !$(e.target).parents('#wpadminbar').size() ){ | |
| $('#wpadminbar li.menupop.hover').removeClass('hover'); | |
| } | |
| }); | |
| } | |
| if( $('#adminmenu > li.wp-has-submenu.wp-not-current-submenu').size() ){ | |
| $('#adminmenu > li.wp-has-submenu.wp-not-current-submenu').click(function(e){ | |
| if( ! $(this).hasClass('hover') ){ | |
| $(this).siblings('li.wp-has-submenu.wp-not-current-submenu').removeClass('hover').children('.wp-submenu').removeClass('sub-open'); | |
| $(this).addClass('hover').children('.wp-submenu').addClass('sub-open'); | |
| e.preventDefault(); | |
| return; | |
| } | |
| }); | |
| $(document).bind('click', function(e) { | |
| if( !$(e.target).parents('#adminmenu').size() ){ | |
| $('#adminmenu > li.wp-has-submenu.wp-not-current-submenu').removeClass('hover').children('.wp-submenu').removeClass('sub-open'); | |
| } | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment