From 7e93e9fbe974943bd97b2e0921d657b129fa1460 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 10 Apr 2013 09:38:46 -0700 Subject: [PATCH] Trigger hovercards on mousemove Summary: I often scroll with keyboard with cursor being somewhere on the screen. Popping hovercards under the cursor is quite distracting. Test Plan: It works like I want in Firefox. There's surprisingly no flickering even though I expected some. It works like before in Chrome, perhaps it sends mousemove events anyway? Reviewers: AnhNhan, epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5632 --- src/__celerity_resource_map__.php | 38 +------------------ .../js/application/core/behavior-hovercard.js | 7 +++- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index cb0da5fe16..f1ff1a21dd 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -1899,7 +1899,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-hovercards' => array( - 'uri' => '/res/7c16603a/rsrc/js/application/core/behavior-hovercard.js', + 'uri' => '/res/b8b4bb47/rsrc/js/application/core/behavior-hovercard.js', 'type' => 'js', 'requires' => array( @@ -3639,33 +3639,6 @@ celerity_register_resource_map(array( ), 'disk' => '/rsrc/css/application/ponder/vote.css', ), - 'raphael-core' => - array( - 'uri' => '/res/3f48575a/rsrc/js/raphael/raphael.js', - 'type' => 'js', - 'requires' => - array( - ), - 'disk' => '/rsrc/js/raphael/raphael.js', - ), - 'raphael-g' => - array( - 'uri' => '/res/b07e5245/rsrc/js/raphael/g.raphael.js', - 'type' => 'js', - 'requires' => - array( - ), - 'disk' => '/rsrc/js/raphael/g.raphael.js', - ), - 'raphael-g-line' => - array( - 'uri' => '/res/a59c8556/rsrc/js/raphael/g.raphael.line.js', - 'type' => 'js', - 'requires' => - array( - ), - 'disk' => '/rsrc/js/raphael/g.raphael.line.js', - ), 'releeph-branch' => array( 'uri' => '/res/6ad6420d/rsrc/css/application/releeph/releeph-branch.css', @@ -3864,15 +3837,6 @@ celerity_register_resource_map(array( ), 'disk' => '/rsrc/css/sprite-tokens.css', ), - 'stripe-core' => - array( - 'uri' => '/res/3b0f0ad4/rsrc/js/stripe/stripe_core.js', - 'type' => 'js', - 'requires' => - array( - ), - 'disk' => '/rsrc/js/stripe/stripe_core.js', - ), 'stripe-payment-form-css' => array( 'uri' => '/res/634a6371/rsrc/css/application/phortune/stripe-payment-form.css', diff --git a/webroot/rsrc/js/application/core/behavior-hovercard.js b/webroot/rsrc/js/application/core/behavior-hovercard.js index a9c97fc037..86a9ef8f5c 100644 --- a/webroot/rsrc/js/application/core/behavior-hovercard.js +++ b/webroot/rsrc/js/application/core/behavior-hovercard.js @@ -10,8 +10,13 @@ JX.behavior('phabricator-hovercards', function(config) { + // We listen for mousemove instead of mouseover to handle the case when user + // scrolls with keyboard. We don't want to display hovercard if node gets + // under the mouse cursor randomly placed somewhere on the screen. This + // unfortunatelly doesn't work in Google Chrome which triggers both mousemove + // and mouseover in this case but works in other browsers. JX.Stratcom.listen( - 'mouseover', + 'mousemove', 'hovercard', function (e) { if (JX.Device.getDevice() != 'desktop') {