1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Fix flickering hovercards

Summary:
Refs T1048, T2902 - This //should// fix flickering hovercards. Probably does not fix displaced hovercards, though could (because of the flickering doing something bad to rendering).

I'm bad with JS D:

Test Plan: Tried out plenty of reload & hover combos. No flickering anymore. Never again.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1048

Differential Revision: https://secure.phabricator.com/D5607
This commit is contained in:
Anh Nhan Nguyen 2013-04-06 12:57:44 -07:00 committed by epriestley
parent fa41a3d6c6
commit 3c8365538a
2 changed files with 11 additions and 3 deletions

View file

@ -3043,7 +3043,7 @@ celerity_register_resource_map(array(
),
'phabricator-hovercard' =>
array(
'uri' => '/res/345f3fca/rsrc/js/application/core/Hovercard.js',
'uri' => '/res/80f2fdb1/rsrc/js/application/core/Hovercard.js',
'type' => 'js',
'requires' =>
array(

View file

@ -48,9 +48,15 @@ JX.install('Hovercard', {
_drawCard : function(phid) {
var self = JX.Hovercard;
// Already displaying
if (self.getCard() && phid == self._visiblePHID) {
return;
}
// Not the current requested card
if (phid != self._visiblePHID) {
return;
}
// Not loaded
if (!(phid in self._cards)) {
return;
}
@ -121,8 +127,10 @@ JX.install('Hovercard', {
for (var phid in r.cards) {
self._cards[phid] = r.cards[phid];
if (self.getCard()) {
self.hide();
// Don't draw if the user is faster than the browser
// Only draw if the user is still requesting the original card
if (self.getCard() && phid != self._visiblePHID) {
continue;
}
self._drawCard(phid);