mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Fixing a race condition for hovercards
Summary: Refs T1048 - Take this setup: D123 D321 Hover with the mouse over one object, and move to another one before it got loaded. You'll have two hovercards. Of these you can't get rid of one anymore. Not through resizing, not through showing another hovercard. (You may have to try a few times). I think it only happens when #2 loads faster than #1. #2 is displayed, then #1 gets loaded and draws. Or something like that. You could have a race condition where one draws after another and overwrites the current node/anchor, without hiding it. This renders the previous card unhideable, even on resize / mouse far away. Test Plan: Did a repro by hovering a lot. Applied this change. Could not repro anymore. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1048 Differential Revision: https://secure.phabricator.com/D5594
This commit is contained in:
parent
886f3d507e
commit
e1b8c9d261
1 changed files with 5 additions and 0 deletions
|
@ -120,6 +120,11 @@ JX.install('Hovercard', {
|
||||||
new JX.Request(uri, function(r) {
|
new JX.Request(uri, function(r) {
|
||||||
for (var phid in r.cards) {
|
for (var phid in r.cards) {
|
||||||
self._cards[phid] = r.cards[phid];
|
self._cards[phid] = r.cards[phid];
|
||||||
|
|
||||||
|
if (self.getCard()) {
|
||||||
|
self.hide();
|
||||||
|
}
|
||||||
|
|
||||||
self._drawCard(phid);
|
self._drawCard(phid);
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
|
|
Loading…
Reference in a new issue