-var showNotice, adminMenu, columns, validateForm, screenMeta, autofold_menu;
+var showNotice, adminMenu, columns, validateForm, screenMeta;
(function($){
// Removed in 3.3.
// (perhaps) needed for back-compat
$(document).ready( function() {
var lastClicked = false, checks, first, last, checked, menu = $('#adminmenu'),
- pageInput = $('input.current-page'), currentPage = pageInput.val(), folded, refresh;
+ pageInput = $('input.current-page'), currentPage = pageInput.val(), refresh;
// admin menu
refresh = function(i, el){ // force the browser to refresh the tabbing index
$('#collapse-menu', menu).click(function(){
var body = $(document.body);
+ // reset any compensation for submenus near the bottom of the screen
+ $('#adminmenu div.wp-submenu').css('margin-top', '');
+
if ( body.hasClass('folded') ) {
body.removeClass('folded');
setUserSetting('mfold', 'o');
over: function(e){
var b, h, o, f, m = $(this).find('.wp-submenu'), menutop, wintop, maxtop;
- if ( !$(document.body).hasClass('folded') && $(this).hasClass('wp-menu-open') )
+ if ( m.is(':visible') )
return;
menutop = $(this).offset().top;
o = maxtop;
if ( o > 1 )
- m.css({'marginTop':'-'+o+'px'});
- else if ( m.css('marginTop') )
- m.css({'marginTop':''});
+ m.css('margin-top', '-'+o+'px');
+ else
+ m.css('margin-top', '');
menu.find('.wp-submenu').removeClass('sub-open');
m.addClass('sub-open');
var el = e.target, selStart = el.selectionStart, selEnd = el.selectionEnd, val = el.value, scroll, sel;
try {
- this.lastKey = 9; // not a standard DOM property, lastKey is to help stop Opera tab event. See blur handler below.
+ this.lastKey = 9; // not a standard DOM property, lastKey is to help stop Opera tab event. See blur handler below.
} catch(err) {}
if ( document.selection ) {
});
}
- // auto-fold the menu when screen is under 800px
- $(window).bind('resize.autofold', function(){
- if ( getUserSetting('mfold') == 'f' )
- return;
-
- var width = $(window).width();
-
- // fold admin menu
- if ( width <= 800 ) {
- if ( !folded ) {
- $(document.body).addClass('folded');
- folded = true;
- }
- } else {
- if ( folded ) {
- $(document.body).removeClass('folded');
- folded = false;
- }
- }
-
- }).triggerHandler('resize');
-
});
// internal use