Admin menu: Revert [31720] for swipe open/closed.
This is problematic on any device that uses swipe for history navigation, particularly iOS. It's also quite unrefined from an interaction point of view and would not be material for this release either way. see #31187. git-svn-id: https://develop.svn.wordpress.org/trunk@31910 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
eced539d8b
commit
ee4ba5c926
@ -705,8 +705,7 @@ $(document).ready( function() {
|
||||
|
||||
window.wpResponsive = {
|
||||
init: function() {
|
||||
var self = this,
|
||||
x, y;
|
||||
var self = this;
|
||||
|
||||
// Modify functionality based on custom activate/deactivate event
|
||||
$document.on( 'wp-responsive-activate.wp-responsive', function() {
|
||||
@ -721,7 +720,7 @@ $(document).ready( function() {
|
||||
$( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) {
|
||||
event.preventDefault();
|
||||
$wpwrap.toggleClass( 'wp-responsive-open' );
|
||||
if ( self.isOpen() ) {
|
||||
if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) {
|
||||
$(this).find('a').attr( 'aria-expanded', 'true' );
|
||||
$( '#adminmenu a:first' ).focus();
|
||||
} else {
|
||||
@ -729,37 +728,6 @@ $(document).ready( function() {
|
||||
}
|
||||
} );
|
||||
|
||||
$window.on( 'touchstart.wp-responsive', function( event ) {
|
||||
var touches = event.originalEvent.touches;
|
||||
|
||||
if ( 1 !== touches.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
x = touches[0].clientX;
|
||||
y = touches[0].clientY;
|
||||
} );
|
||||
|
||||
$window.on( 'touchend.wp-responsive', function( event ) {
|
||||
var touches = event.originalEvent.changedTouches,
|
||||
isOpen = self.isOpen(),
|
||||
distanceX;
|
||||
|
||||
if ( 1 === touches.length && x && y ) {
|
||||
if ( ( window.isRtl && isOpen ) || ( ! window.isRtl && ! isOpen ) ) {
|
||||
distanceX = touches[0].clientX - x;
|
||||
} else {
|
||||
distanceX = x - touches[0].clientX;
|
||||
}
|
||||
|
||||
if ( distanceX > 30 && distanceX > Math.abs( touches[0].clientY - y ) ) {
|
||||
$( '#wp-admin-bar-menu-toggle' ).trigger( 'click' );
|
||||
}
|
||||
}
|
||||
|
||||
x = y = 0;
|
||||
} );
|
||||
|
||||
// Add menu events
|
||||
$adminmenu.on( 'click.wp-responsive', 'li.wp-has-submenu > a', function( event ) {
|
||||
if ( ! $adminmenu.data('wp-responsive') ) {
|
||||
@ -783,10 +751,6 @@ $(document).ready( function() {
|
||||
});
|
||||
},
|
||||
|
||||
isOpen: function() {
|
||||
return $wpwrap.hasClass( 'wp-responsive-open' );
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
setPinMenu();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user