Make WordPress Core

Changeset 26160


Ignore:
Timestamp:
11/14/2013 05:50:40 AM (12 years ago)
Author:
nacin
Message:

Fix JSHint errors in admin-bar.js.

props kadamwhite.
fixes #25970.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/admin-bar.js

    r24259 r26160  
     1/* jshint loopfunc: true */
    12// use jQuery and hoverIntent if loaded
    23if ( typeof(jQuery) != 'undefined' ) {
    34    if ( typeof(jQuery.fn.hoverIntent) == 'undefined' ) {
     5        /* jshint ignore:start */
    46        // hoverIntent r6 - Copy of wp-includes/js/hoverIntent.min.js
    57        (function(a){a.fn.hoverIntent=function(m,d,h){var j={interval:100,sensitivity:7,timeout:0};if(typeof m==="object"){j=a.extend(j,m)}else{if(a.isFunction(d)){j=a.extend(j,{over:m,out:d,selector:h})}else{j=a.extend(j,{over:m,out:m,selector:d})}}var l,k,g,f;var e=function(n){l=n.pageX;k=n.pageY};var c=function(o,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if((Math.abs(g-l)+Math.abs(f-k))<j.sensitivity){a(n).off("mousemove.hoverIntent",e);n.hoverIntent_s=1;return j.over.apply(n,[o])}else{g=l;f=k;n.hoverIntent_t=setTimeout(function(){c(o,n)},j.interval)}};var i=function(o,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);n.hoverIntent_s=0;return j.out.apply(n,[o])};var b=function(p){var o=jQuery.extend({},p);var n=this;if(n.hoverIntent_t){n.hoverIntent_t=clearTimeout(n.hoverIntent_t)}if(p.type=="mouseenter"){g=o.pageX;f=o.pageY;a(n).on("mousemove.hoverIntent",e);if(n.hoverIntent_s!=1){n.hoverIntent_t=setTimeout(function(){c(o,n)},j.interval)}}else{a(n).off("mousemove.hoverIntent",e);if(n.hoverIntent_s==1){n.hoverIntent_t=setTimeout(function(){i(o,n)},j.timeout)}}};return this.on({"mouseenter.hoverIntent":b,"mouseleave.hoverIntent":b},j.selector)}})(jQuery);
     8        /* jshint ignore:end */
    69    }
    710    jQuery(document).ready(function($){
     
    5457
    5558        adminbar.find('li.menupop').hoverIntent({
    56             over: function(e){
     59            over: function() {
    5760                if ( disableHoverIntent )
    5861                    return;
     
    6063                $(this).addClass('hover');
    6164            },
    62             out: function(e){
     65            out: function() {
    6366                if ( disableHoverIntent )
    6467                    return;
     
    121124        // fix focus bug in WebKit
    122125        $('.screen-reader-shortcut').keydown( function(e) {
     126            var id, ua;
     127
    123128            if ( 13 != e.which )
    124129                return;
    125130
    126             var id = $(this).attr('href');
    127 
    128             var ua = navigator.userAgent.toLowerCase();
     131            id = $( this ).attr( 'href' );
     132
     133            ua = navigator.userAgent.toLowerCase();
     134
    129135            if ( ua.indexOf('applewebkit') != -1 && id && id.charAt(0) == '#' ) {
    130136                setTimeout(function () {
Note: See TracChangeset for help on using the changeset viewer.