From d9adedd9d64dd56d922df16e23eeb2b1f4f692de Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Wed, 11 Mar 2015 15:55:35 -0700 Subject: [PATCH] Conpherence - smooth out user interaction switching threads in the durable column Summary: Ref T7014. This changes the title and selected icon right as the user clicks it. This could //maybe// be in the "willLoadThread" callback hook, but it doesn't happen every time we load a thread, just **this** time so keep it right in the listener for now. Test Plan: switched some threads and liked what I saw Reviewers: epriestley, chad Subscribers: Korvin, epriestley Maniphest Tasks: T7014 Differential Revision: https://secure.phabricator.com/D12043 --- resources/celerity/map.php | 22 +++++++++---------- .../view/ConpherenceDurableColumnView.php | 1 + .../conpherence/behavior-durable-column.js | 13 +++++++++++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 7a560e6e10..f1e5b10517 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -353,7 +353,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' => '0324970d', - 'rsrc/js/application/conpherence/behavior-durable-column.js' => '8908d403', + 'rsrc/js/application/conpherence/behavior-durable-column.js' => '44100dc7', 'rsrc/js/application/conpherence/behavior-menu.js' => 'c4151295', 'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', @@ -585,7 +585,7 @@ return array( 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 'javelin-behavior-diffusion-pull-lastmodified' => '2b228192', 'javelin-behavior-doorkeeper-tag' => 'e5822781', - 'javelin-behavior-durable-column' => '8908d403', + 'javelin-behavior-durable-column' => '44100dc7', 'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-fancy-datepicker' => 'c51ae228', 'javelin-behavior-global-drag-and-drop' => '07f199d8', @@ -1110,6 +1110,15 @@ return array( 'javelin-dom', 'javelin-request', ), + '44100dc7' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-scrollbar', + 'javelin-quicksand', + 'phabricator-keyboard-shortcut', + 'conpherence-thread-manager', + ), '44168bad' => array( 'javelin-behavior', 'javelin-dom', @@ -1505,15 +1514,6 @@ return array( 'javelin-dom', 'javelin-vector', ), - '8908d403' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-scrollbar', - 'javelin-quicksand', - 'phabricator-keyboard-shortcut', - 'conpherence-thread-manager', - ), '8a41885b' => array( 'javelin-install', 'javelin-dom', diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php index c3a86929c8..c903b09835 100644 --- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php +++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php @@ -186,6 +186,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { 'sigil' => 'conpherence-durable-column-thread-icon', 'meta' => array( 'threadID' => $conpherence->getID(), + 'threadTitle' => $data['js_title'], ), ), phutil_tag( diff --git a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js index 8d170d9242..37cd157acf 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js +++ b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js @@ -164,7 +164,20 @@ JX.behavior('durable-column', function(config, statics) { 'conpherence-durable-column-thread-icon', function (e) { e.kill(); + var icons = JX.DOM.scry( + JX.$('conpherence-durable-column'), + 'a', + 'conpherence-durable-column-thread-icon'); var data = e.getNodeData('conpherence-durable-column-thread-icon'); + var cdata = null; + for (var i = 0; i < icons.length; i++) { + cdata = JX.Stratcom.getData(icons[i]); + JX.DOM.alterClass( + icons[i], + 'selected', + cdata.threadID == data.threadID); + } + JX.DOM.setContent(_getColumnTitleNode(), data.threadTitle); threadManager.loadThreadByID(data.threadID); });