Ticket #31187: 31187.2.patch
| File 31187.2.patch, 1.9 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/js/common.js
707 707 708 708 window.wpResponsive = { 709 709 init: function() { 710 var self = this; 710 var self = this, 711 x, y; 711 712 712 713 // Modify functionality based on custom activate/deactivate event 713 714 $document.on( 'wp-responsive-activate.wp-responsive', function() { … … 722 723 $( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) { 723 724 event.preventDefault(); 724 725 $wpwrap.toggleClass( 'wp-responsive-open' ); 725 if ( $wpwrap.hasClass( 'wp-responsive-open') ) {726 if ( self.isOpen() ) { 726 727 $(this).find('a').attr( 'aria-expanded', 'true' ); 727 728 $( '#adminmenu a:first' ).focus(); 728 729 } else { … … 730 731 } 731 732 } ); 732 733 734 $window.on( 'touchstart.wp-responsive', function( event ) { 735 var touches = event.originalEvent.touches; 736 737 if ( 1 !== touches.length ) { 738 return; 739 } 740 741 x = touches[0].clientX; 742 y = touches[0].clientY; 743 } ); 744 745 $window.on( 'touchend.wp-responsive', function( event ) { 746 var touches = event.originalEvent.changedTouches, 747 distanceX; 748 749 if ( 1 === touches.length && x && y ) { 750 if ( window.isRtl == self.isOpen() ) { 751 distanceX = touches[0].clientX - x; 752 } else { 753 distanceX = x - touches[0].clientX; 754 } 755 756 if ( distanceX > Math.abs( touches[0].clientY - y ) ) { 757 $( '#wp-admin-bar-menu-toggle' ).trigger( 'click' ); 758 } 759 } 760 761 x = y = 0; 762 } ); 763 733 764 // Add menu events 734 765 $adminmenu.on( 'click.wp-responsive', 'li.wp-has-submenu > a', function( event ) { 735 766 if ( ! $adminmenu.data('wp-responsive') ) { … … 753 784 }); 754 785 }, 755 786 787 isOpen: function() { 788 return $wpwrap.hasClass( 'wp-responsive-open' ); 789 }, 790 756 791 activate: function() { 757 792 setPinMenu(); 758 793
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)