From a4053bb5808edda949d134f7fdca637f35510f7a Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 14 Feb 2018 15:18:10 -0800 Subject: [PATCH] When a ChangesetList sleeps after a Quicksand navigation, also hide any visible banner Summary: Fixes T13080. The banner wasn't properly included in the sleep/wake logic. Test Plan: Mentioned `Dxxx` on a task. Enabled persistent chat to activate Quicksand. Reloaded page. Clicked `Dxxx`. Scrolled down until a changeset header appeared. Pressed back button. - Before patch: ended up on task, with header still around. - After patch: ended up on task, with header properly vanquished. Pressed "forward", ended up back on the revision with the header again. Maniphest Tasks: T13080 Differential Revision: https://secure.phabricator.com/D19086 --- resources/celerity/map.php | 14 +++++++------- .../js/application/diff/DiffChangesetList.js | 16 +++++++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index f3ead4de53..a08f04658e 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -13,7 +13,7 @@ return array( 'core.pkg.js' => '3ac6e174', 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '113e692c', - 'differential.pkg.js' => '5d53d5ce', + 'differential.pkg.js' => 'f6d809c0', 'diffusion.pkg.css' => 'a2d17c7d', 'diffusion.pkg.js' => '6134c5a1', 'favicon.ico' => '30672e08', @@ -396,7 +396,7 @@ return array( 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 'rsrc/js/application/diff/DiffChangeset.js' => 'b49b59d6', - 'rsrc/js/application/diff/DiffChangesetList.js' => '1f2e5265', + 'rsrc/js/application/diff/DiffChangesetList.js' => 'e74b7517', 'rsrc/js/application/diff/DiffInline.js' => 'e83d28f3', 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', @@ -776,7 +776,7 @@ return array( 'phabricator-darkmessage' => 'c48cccdd', 'phabricator-dashboard-css' => 'fe5b1869', 'phabricator-diff-changeset' => 'b49b59d6', - 'phabricator-diff-changeset-list' => '1f2e5265', + 'phabricator-diff-changeset-list' => 'e74b7517', 'phabricator-diff-inline' => 'e83d28f3', 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 'phabricator-draggable-list' => 'bea6e7f4', @@ -1044,10 +1044,6 @@ return array( 'javelin-uri', 'javelin-routable', ), - '1f2e5265' => array( - 'javelin-install', - 'phuix-button-view', - ), '1f6794f6' => array( 'javelin-behavior', 'javelin-stratcom', @@ -2093,6 +2089,10 @@ return array( 'javelin-workflow', 'javelin-magical-init', ), + 'e74b7517' => array( + 'javelin-install', + 'phuix-button-view', + ), 'e83d28f3' => array( 'javelin-dom', ), diff --git a/webroot/rsrc/js/application/diff/DiffChangesetList.js b/webroot/rsrc/js/application/diff/DiffChangesetList.js index e62d2f51dd..5eba051d93 100644 --- a/webroot/rsrc/js/application/diff/DiffChangesetList.js +++ b/webroot/rsrc/js/application/diff/DiffChangesetList.js @@ -128,6 +128,9 @@ JX.install('DiffChangesetList', { this._redrawFocus(); this._redrawSelection(); this.resetHover(); + + this._bannerChangeset = null; + this._redrawBanner(); }, wake: function() { @@ -136,6 +139,9 @@ JX.install('DiffChangesetList', { this._redrawFocus(); this._redrawSelection(); + this._bannerChangeset = null; + this._redrawBanner(); + if (this._initialized) { return; } @@ -1374,6 +1380,11 @@ JX.install('DiffChangesetList', { var node = this._getBannerNode(); var changeset = this._getVisibleChangeset(); + if (!changeset) { + JX.DOM.remove(node); + return; + } + // Don't do anything if nothing has changed. This seems to avoid some // flickering issues in Safari, at least. if (this._bannerChangeset === changeset) { @@ -1381,11 +1392,6 @@ JX.install('DiffChangesetList', { } this._bannerChangeset = changeset; - if (!changeset) { - JX.DOM.remove(node); - return; - } - var inlines = this._getInlinesByType(); var unsaved = inlines.unsaved;