[ Index ] |
PHP Cross Reference of BuddyPress |
[Summary view] [Print] [Text view]
1 var showNotice, adminMenu, columns; 2 (function($){ 3 // sidebar admin menu 4 adminMenu = { 5 6 init : function() { 7 $('ul#bbAdminMenu li.bb-menu div.bb-menu-toggle').each( function() { 8 if ( $(this).siblings('div.bb-menu-sub-wrap').length ) 9 $(this).click(function(){ adminMenu.toggle( $(this).siblings('div.bb-menu-sub-wrap') ); }); 10 else 11 $(this).hide(); 12 }); 13 14 $('#bbAdminMenu li.bb-menu.bb-menu-separator a').click(function(){ 15 if ( $('body').hasClass('bb-menu-folded') ) { 16 adminMenu.fold(1); 17 deleteUserSetting( 'fm' ); 18 } else { 19 adminMenu.fold(); 20 setUserSetting( 'fm', 'f' ); 21 } 22 return false; 23 }); 24 25 if ( $('body').hasClass('bb-menu-folded') ) { 26 this.fold(); 27 } 28 this.restoreMenuState(); 29 }, 30 31 restoreMenuState : function() { 32 $('ul#bbAdminMenu li.bb-menu.bb-menu-has-submenu').each(function(i, e) { 33 var v = getUserSetting( 'm'+i ); 34 if ( $(e).hasClass('bb-menu-current') ) return true; // leave the current parent open 35 36 if ( 'o' == v ) $(e).addClass('bb-menu-open'); 37 else if ( 'c' == v ) $(e).removeClass('bb-menu-open'); 38 }); 39 }, 40 41 toggle : function(el) { 42 el['slideToggle'](150, function(){el.css('display','');}).parent().toggleClass( 'bb-menu-open' ); 43 44 $('ul#bbAdminMenu li.bb-menu.bb-menu-has-submenu').each(function(i, e) { 45 var v = $(e).hasClass('bb-menu-open') ? 'o' : 'c'; 46 setUserSetting( 'm'+i, v ); 47 }); 48 49 return false; 50 }, 51 52 fold : function(off) { 53 if (off) { 54 $('body').removeClass('bb-menu-folded'); 55 $('#bbAdminMenu li.bb-menu.bb-menu-has-submenu').unbind(); 56 } else { 57 $('body').addClass('bb-menu-folded'); 58 $('#bbAdminMenu li.bb-menu.bb-menu-has-submenu').hoverIntent({ 59 over: function(e){ 60 var m, b, h, o, f; 61 m = $(this).find('div.bb-menu-sub-wrap'); 62 b = m.parent().offset().top + m.height() + 1; // Bottom offset of the menu 63 h = $('#bbWrap').height(); // Height of the entire page 64 o = 60 + b - h; 65 f = $(window).height() + $('body').scrollTop() - 15; // The fold 66 if (f < (b - o)) { 67 o = b - f; 68 } 69 if (o > 1) { 70 m.css({'marginTop':'-'+o+'px'}); 71 } else if ( m.css('marginTop') ) { 72 m.css({'marginTop':''}); 73 } 74 m.addClass('bb-menu-sub-open'); 75 }, 76 out: function(){ $(this).find('div.bb-menu-sub-wrap').removeClass('bb-menu-sub-open').css({'marginTop':''}); }, 77 timeout: 220, 78 sensitivity: 8, 79 interval: 100 80 }); 81 } 82 } 83 }; 84 85 $(document).ready(function(){ 86 adminMenu.init(); 87 $('thead .check-column :checkbox, tfoot .check-column :checkbox').click( function() { 88 $(this).parents( 'table' ).find( '.check-column :checkbox' ).attr( 'checked', $(this).is( ':checked' ) ? 'checked' : false ); 89 } ); 90 }); 91 92 93 })(jQuery);
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Dec 7 01:01:35 2017 | Cross-referenced by PHPXref 0.7.1 |