Trigger 'howdy' dropdown by click instead of hover. see #17324.

git-svn-id: http://svn.automattic.com/wordpress/trunk@17851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
koopersmith
2011-05-10 20:36:12 +00:00
parent d822248130
commit 33a0cf3286
7 changed files with 38 additions and 19 deletions

View File

@@ -226,7 +226,7 @@ screenMeta = {
};
$(document).ready( function() {
var lastClicked = false, checks, first, last, checked;
var lastClicked = false, checks, first, last, checked, dropdown;
// Move .updated and .error alert boxes. Don't move boxes designed to be inline.
$('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2');
@@ -235,6 +235,24 @@ $(document).ready( function() {
// Init screen meta
screenMeta.init();
// User info dropdown.
dropdown = {
doc: $(document),
element: $('#user_info'),
open: function() {
if ( ! dropdown.element.hasClass('active') ) {
dropdown.element.addClass('active');
dropdown.doc.one( 'click', dropdown.close );
return false;
}
},
close: function() {
dropdown.element.removeClass('active');
}
};
dropdown.element.click( dropdown.open );
// check all checkboxes
$('tbody').children().children('.check-column').find(':checkbox').click( function(e) {
if ( 'undefined' == e.shiftKey ) { return true; }