From 2fab72d43bf6d507cb3e29f709254875a012daba Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Tue, 21 Apr 2015 11:01:05 -0700 Subject: [PATCH] Quicksand - update title while navigating about Summary: Fixes T7744. Also fixes a bug where we were copying the response object erroneously; that's not necessary to move around since we cleanly initialize it for each load Test Plan: from user profile, clicked feed tab and saw new title. clicked calendar tab and saw new title. clicked back and saw feed title and page render. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7744 Differential Revision: https://secure.phabricator.com/D12487 --- resources/celerity/map.php | 34 +++++++++---------- src/view/page/PhabricatorStandardPageView.php | 4 ++- .../rsrc/externals/javelin/lib/Quicksand.js | 3 +- .../conpherence/behavior-durable-column.js | 8 +++++ 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 4bf9aecbbf..285a67deba 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -205,7 +205,7 @@ return array( 'rsrc/externals/javelin/lib/JSON.js' => '69adf288', 'rsrc/externals/javelin/lib/Leader.js' => '331b1611', 'rsrc/externals/javelin/lib/Mask.js' => '8a41885b', - 'rsrc/externals/javelin/lib/Quicksand.js' => '8750a840', + 'rsrc/externals/javelin/lib/Quicksand.js' => '97720512', 'rsrc/externals/javelin/lib/Request.js' => '94b750d2', 'rsrc/externals/javelin/lib/Resource.js' => '44959b73', 'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692', @@ -356,7 +356,7 @@ return array( 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '0a5192c4', - 'rsrc/js/application/conpherence/behavior-durable-column.js' => '4de3bda8', + 'rsrc/js/application/conpherence/behavior-durable-column.js' => '657c2b50', 'rsrc/js/application/conpherence/behavior-menu.js' => '077a1dab', 'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', @@ -590,7 +590,7 @@ return array( 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 'javelin-behavior-diffusion-pull-lastmodified' => '2b228192', 'javelin-behavior-doorkeeper-tag' => 'e5822781', - 'javelin-behavior-durable-column' => '4de3bda8', + 'javelin-behavior-durable-column' => '657c2b50', 'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-fancy-datepicker' => 'c51ae228', 'javelin-behavior-global-drag-and-drop' => 'bbdf75ca', @@ -677,7 +677,7 @@ return array( 'javelin-leader' => '331b1611', 'javelin-magical-init' => '3010e992', 'javelin-mask' => '8a41885b', - 'javelin-quicksand' => '8750a840', + 'javelin-quicksand' => '97720512', 'javelin-reactor' => '2b8de964', 'javelin-reactor-dom' => 'c90a04fc', 'javelin-reactor-node-calmer' => '76f4ebed', @@ -1161,16 +1161,6 @@ return array( 'javelin-dom', 'phuix-dropdown-menu', ), - '4de3bda8' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-behavior-device', - 'javelin-scrollbar', - 'javelin-quicksand', - 'phabricator-keyboard-shortcut', - 'conpherence-thread-manager', - ), '4e3e79a6' => array( 'javelin-behavior', 'javelin-stratcom', @@ -1300,6 +1290,16 @@ return array( 'javelin-workflow', 'javelin-dom', ), + '657c2b50' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-behavior-device', + 'javelin-scrollbar', + 'javelin-quicksand', + 'phabricator-keyboard-shortcut', + 'conpherence-thread-manager', + ), '6882e80a' => array( 'javelin-dom', ), @@ -1482,9 +1482,6 @@ return array( 'aphront-typeahead-control-css', 'phui-tag-view-css', ), - '8750a840' => array( - 'javelin-install', - ), '87cb6b51' => array( 'javelin-behavior', 'javelin-dom', @@ -1603,6 +1600,9 @@ return array( 'javelin-resource', 'javelin-routable', ), + 97720512 => array( + 'javelin-install', + ), '988040b4' => array( 'javelin-install', 'javelin-dom', diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index c081238712..adb8931ca8 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -583,7 +583,9 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { } private function buildQuicksandConfig() { - return $this->buildAphlictListenConfigData(); + return array( + 'title' => $this->getTitle(), + ) + $this->buildAphlictListenConfigData(); } private function buildAphlictListenConfigData() { diff --git a/webroot/rsrc/externals/javelin/lib/Quicksand.js b/webroot/rsrc/externals/javelin/lib/Quicksand.js index e989b2c14b..c1f80d892d 100644 --- a/webroot/rsrc/externals/javelin/lib/Quicksand.js +++ b/webroot/rsrc/externals/javelin/lib/Quicksand.js @@ -236,9 +236,8 @@ JX.install('Quicksand', { newResponse: self._responses[self._current], oldResponse: self._responses[self._onpage] }); - - self._responses[self._onpage] = self._responses[self._current]; self._onpage = self._current; + // Scroll to the top of the page and trigger any layout adjustments. // TODO: Maybe store the scroll position? JX.DOM.scrollToPosition(0, 0); diff --git a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js index 1b98856878..adcaa382a3 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js +++ b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js @@ -341,6 +341,14 @@ JX.behavior('durable-column', function(config, statics) { } }); + JX.Stratcom.listen( + 'quicksand-redraw', + null, + function (e) { + var new_data = e.getData().newResponse; + JX.Title.setTitle(new_data.title); + }); + _updateColumnVisibility(); });