chrome_extension/js/hover.js
/**
 * This is the event handler for mouseenter on the links. First we check to see
 * if there is a hideHover() pending, if so we will cancel it. Next we will
 * check if we need to request new data via ajax. Finally we show the hover
 * with a 250 ms delay to avoid unintended triggers.
 *
 * @argument {object} e The event object.
 **/
This is the event handler for mouseenter on the links. First we check to see
if there is a hideHover() pending, if so we will cancel it. Next we will
check if we need to request new data via ajax. Finally we show the hover
with a 250 ms delay to avoid unintended triggers.

@argument {object} e The event object.
This is the event handler for mouseenter on the links . First we check to see if there is a hideHover () pending if so we will cancel it . Next we will check if we need to request new data via ajax . Finally we show the hover with a 250 ms delay to avoid unintended triggers . @argument { object } e The event object .
function handleMouseEnter(e) {
  var thingElement = $(e.target).closest('.thing');
  var linkId = $(thingElement).data('fullname');
  var url = $(e.target).attr('href');
  var showDelay = 250;
  var regex = new RegExp('/r/.*/comments');
  if (regex.exec(url) !== null &&
      $(e.target).closest('.entry').find('.expando-button.selftext').length === 1) {
    if(hideTimeout !== null && lastLink !== linkId) {
      clearTimeout(hideTimeout);
      hideTimeout = null;
      showDelay = 0;
    }
    showTimeout = setTimeout(function() {
      showTimeout = null;
      if (lastLink !== linkId) {
	lastUrl = window.location.protocol + '//www.reddit.com' + url;
	populateHover(linkId);
      }
      positionHover($(e.target));
      showHover();
    }, showDelay);
  }
}
function handleMouseEnter ( e ) { var thingElement = $ ( e . target ) . closest ( '.thing' ) ; var linkId = $ ( thingElement ) . data ( 'fullname' ) ; var url = $ ( e . target ) . attr ( 'href' ) ; var showDelay = 250 ; var regex = new RegExp ( '/r/.*/comments' ) ; if ( regex . exec ( url ) !== null && $ ( e . target ) . closest ( '.entry' ) . find ( '.expando-button.selftext' ) . length === 1 ) { if ( hideTimeout !== null && lastLink !== linkId ) { clearTimeout ( hideTimeout ) ; hideTimeout = null ; showDelay = 0 ; } showTimeout = setTimeout ( function ( ) { showTimeout = null ; if ( lastLink !== linkId ) { lastUrl = window . location . protocol + '//www.reddit.com' + url ; populateHover ( linkId ) ; } positionHover ( $ ( e . target ) ) ; showHover ( ) ; } , showDelay ) ; } }
This is the event handler for mouseenter on the links.
This is the event handler for mouseenter on the links .