chrome_extension/js/hover.js
/**
 * This function adds the floating div we use to display the content. We are
 * handling mouseenter and mouseleave events on it to avoid hiding the hover
 * when the user moves the mouse over it. This allows the user to press links
 * in the content.
 **/
This function adds the floating div we use to display the content. We are
handling mouseenter and mouseleave events on it to avoid hiding the hover
when the user moves the mouse over it. This allows the user to press links
in the content.
This function adds the floating div we use to display the content . We are handling mouseenter and mouseleave events on it to avoid hiding the hover when the user moves the mouse over it . This allows the user to press links in the content .
function initHover() {
  $('body').append('<div id="reddit-hover">a</div>');
  $('#reddit-hover').hide();
  $('#reddit-hover').hover(function() {
    if(hideTimeout !== null) {
      clearTimeout(hideTimeout);
      hideTimeout = null;
    }
  }, handleMouseLeave);
}
function initHover ( ) { $ ( 'body' ) . append ( '<div id="reddit-hover">a</div>' ) ; $ ( '#reddit-hover' ) . hide ( ) ; $ ( '#reddit-hover' ) . hover ( function ( ) { if ( hideTimeout !== null ) { clearTimeout ( hideTimeout ) ; hideTimeout = null ; } } , handleMouseLeave ) ; }
This function adds the floating div we use to display the content.
This function adds the floating div we use to display the content .
// Don't hide the hover if the mouse enters the hover.