panel.focus();
link.addClass('screen-meta-active').attr('aria-expanded', true);
});
+
+ $( document ).trigger( 'screen:options:open' );
},
close: function( panel, link ) {
$('.screen-meta-toggle').css('visibility', '');
panel.parent().hide();
});
+
+ $( document ).trigger( 'screen:options:close' );
}
};
/**
* Help tabs.
*/
-$('.contextual-help-tabs').delegate('a', 'click focus', function(e) {
+$('.contextual-help-tabs').delegate('a', 'click', function(e) {
var link = $(this),
panel;
});
$('#collapse-menu').on('click.collapse-menu', function() {
- var body = $( document.body ), respWidth;
+ var body = $( document.body ), respWidth, state;
// reset any compensation for submenus near the bottom of the screen
$('#adminmenu div.wp-submenu').css('margin-top', '');
respWidth = Math.max( window.innerWidth, document.documentElement.clientWidth );
} else {
// IE < 9 doesn't support @media CSS rules
- respWidth = 901;
+ respWidth = 961;
}
- if ( respWidth && respWidth < 900 ) {
+ if ( respWidth && respWidth < 960 ) {
if ( body.hasClass('auto-fold') ) {
body.removeClass('auto-fold').removeClass('folded');
setUserSetting('unfold', 1);
setUserSetting('mfold', 'o');
+ state = 'open';
} else {
body.addClass('auto-fold');
setUserSetting('unfold', 0);
+ state = 'folded';
}
} else {
if ( body.hasClass('folded') ) {
body.removeClass('folded');
setUserSetting('mfold', 'o');
+ state = 'open';
} else {
body.addClass('folded');
setUserSetting('mfold', 'f');
+ state = 'folded';
}
}
+
+ $( document ).trigger( 'wp-collapse-menu', { state: state } );
});
if ( 'ontouchstart' in window || /IEMobile\/[1-9]/.test(navigator.userAgent) ) { // touch screen device
window.wpResponsive = {
init: function() {
- var self = this,
- scrollStart = 0;
+ var self = this;
// Modify functionality based on custom activate/deactivate event
$document.on( 'wp-responsive-activate.wp-responsive', function() {
} );
// Add menu events
- $adminmenu.on( 'touchstart.wp-responsive', 'li.wp-has-submenu > a', function() {
- scrollStart = $window.scrollTop();
- }).on( 'touchend.wp-responsive click.wp-responsive', 'li.wp-has-submenu > a', function( event ) {
- if ( ! $adminmenu.data('wp-responsive') ||
- ( event.type === 'touchend' && $window.scrollTop() !== scrollStart ) ) {
-
+ $adminmenu.on( 'click.wp-responsive', 'li.wp-has-submenu > a', function( event ) {
+ if ( ! $adminmenu.data('wp-responsive') ) {
return;
}
window.wpResponsive.init();
});
-// make Windows 8 devices playing along nicely
+// Make Windows 8 devices play along nicely.
(function(){
if ( '-ms-user-select' in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/) ) {
var msViewportStyle = document.createElement( 'style' );