Ticket #19088: admin-bar.dev.js.patch
File admin-bar.dev.js.patch, 3.1 KB (added by , 13 years ago) |
---|
-
wp-includes/js/admin-bar.dev.js
4 4 (function(a){a.fn.hoverIntent=function(l,j){var m={sensitivity:7,interval:100,timeout:0};m=a.extend(m,j?{over:l,out:j}:l);var o,n,h,d;var e=function(f){o=f.pageX;n=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-o)+Math.abs(d-n))<m.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return m.over.apply(f,[g])}else{h=o;d=n;f.hoverIntent_t=setTimeout(function(){c(g,f)},m.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return m.out.apply(f,[g])};var b=function(q){var f=this;var g=(q.type=="mouseover"?q.fromElement:q.toElement)||q.relatedTarget;while(g&&g!=this){try{g=g.parentNode}catch(q){g=this}}if(g==this){if(a.browser.mozilla){if(q.type=="mouseout"){f.mtout=setTimeout(function(){k(q,f)},30)}else{if(f.mtout){f.mtout=clearTimeout(f.mtout)}}}return}else{if(f.mtout){f.mtout=clearTimeout(f.mtout)}k(q,f)}};var k=function(p,f){var g=jQuery.extend({},p);if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(p.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},m.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},m.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery); 5 5 6 6 jQuery(document).ready(function($){ 7 var refresh = function(i, el){ // force the browser to refresh the tabbing index 8 var node = $(el), tab = node.attr('tabindex'); 9 if ( tab ) 10 node.attr('tabindex', '0').attr('tabindex', tab); 11 }; 12 7 13 $('#wpadminbar').removeClass('nojq').removeClass('nojs').find('li.menupop').hoverIntent({ 8 14 over: function(e){ 9 15 $(this).addClass('hover'); … … 23 29 }).focus().select(); 24 30 }); 25 31 26 $('#wpadminbar ul > li > .ab-item').bind('focus.adminbar', function(){ 27 $(this).parent().addClass('hover').find('.ab-item').each(function(i, el){ 28 var node = $(el), tab = node.attr('tabindex'); 29 if ( tab ) 30 node.attr('tabindex', '0').attr('tabindex', tab); 31 }); 32 }).bind('blur.adminbar', function(){ 33 var t = $(this); 32 $('#wpadminbar li.menupop > .ab-item').bind('keydown.adminbar', function(e){ 33 if ( e.which != 13 ) 34 return; 34 35 35 setTimeout(function(){ 36 if ( !t.siblings('div').find('.ab-item:focus').length ) 37 t.parent().removeClass('hover'); 38 }, 200); 39 }); 36 var target = $(e.target); 40 37 41 $('.ab-top-menu li ul li .ab-item').bind('blur.adminbar', function(){ 42 var top = $(this).parents('li.menupop'); 38 e.stopPropagation(); 39 e.preventDefault(); 40 target.parent().toggleClass('hover'); 43 41 44 setTimeout(function(){ 45 top.each( function() { 46 var t = $(this); 42 target.siblings('.ab-sub-wrapper').find('.ab-item').each(refresh); 43 }).each(refresh); 47 44 48 if ( ! t.find('.ab-item:focus').length )49 t.removeClass('hover');50 });51 }, 100);52 });53 54 45 }); 55 46 } else { 56 47 (function(d, w) {