X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be15bd505d66a91e2c80062190b13e315a04a9..72836ec95a52eacbda4dc5aa296b7dd6de08bd3b:/wp-admin/js/common.js diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index b1327f99..822af979 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -160,7 +160,7 @@ $('.contextual-help-tabs').delegate('a', 'click focus', function(e) { }); $(document).ready( function() { - var lastClicked = false, checks, first, last, checked, menu = $('#adminmenu'), mobileEvent, + var lastClicked = false, checks, first, last, checked, sliced, menu = $('#adminmenu'), mobileEvent, pageInput = $('input.current-page'), currentPage = pageInput.val(); // when the menu is folded, make the fly-out submenu header clickable @@ -185,15 +185,15 @@ $(document).ready( function() { if ( body.hasClass('auto-fold') ) { body.removeClass('auto-fold').removeClass('folded'); setUserSetting('unfold', 1); - deleteUserSetting('mfold'); + setUserSetting('mfold', 'o'); } else { body.addClass('auto-fold'); - deleteUserSetting('unfold'); + setUserSetting('unfold', 0); } } else { if ( body.hasClass('folded') ) { body.removeClass('folded'); - deleteUserSetting('mfold'); + setUserSetting('mfold', 'o'); } else { body.addClass('folded'); setUserSetting('mfold', 'f'); @@ -286,7 +286,8 @@ $(document).ready( function() { last = checks.index( this ); checked = $(this).prop('checked'); if ( 0 < first && 0 < last && first != last ) { - checks.slice( first, last ).prop( 'checked', function(){ + sliced = ( last > first ) ? checks.slice( first, last ) : checks.slice( last, first ); + sliced.prop( 'checked', function() { if ( $(this).closest('tr').is(':visible') ) return checked; @@ -333,6 +334,20 @@ $(document).ready( function() { }); }); + // Show row actions on keyboard focus of its parent container element or any other elements contained within + var transitionTimeout, focusedRowActions; + $( 'td.post-title, td.title, td.comment, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap' ).focusin(function(){ + clearTimeout( transitionTimeout ); + focusedRowActions = $(this).find( '.row-actions' ); + focusedRowActions.addClass( 'visible' ); + }).focusout(function(){ + // Tabbing between post title and .row-actions links needs a brief pause, otherwise + // the .row-actions div gets hidden in transit in some browsers (ahem, Firefox). + transitionTimeout = setTimeout(function(){ + focusedRowActions.removeClass( 'visible' ); + }, 30); + }); + $('#default-password-nag-no').click( function() { setUserSetting('default_password_nag', 'hide'); $('div.default-password-nag').hide(); @@ -395,6 +410,10 @@ $(document).ready( function() { }); } + $('.search-box input[type="search"], .search-box input[type="submit"]').mousedown(function () { + $('select[name^="action"]').val('-1'); + }); + // Scroll into view when focused $('#contextual-help-link, #show-settings-link').on( 'focus.scroll-into-view', function(e){ if ( e.target.scrollIntoView )