From 7d7deaf69802287f28458be3dae831a7318ee257 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Wed, 11 Mar 2015 16:20:13 -0700 Subject: [PATCH] Conpherence - fix "pop in" effect Summary: Ref T7014. This got broken in today's action. For whatever reason the only way I can get the CSS to show up correctly is to move the require statement to where it was before rP5ef99dba2afc9f9ed3ca77707366a78be15f4871. Otherwise, this feature massages the UI a bit to make sure the "loading" stuff is set correctly in this state. Test Plan: toggled conpherence open and it looked good. reloaded and it looked good. Reviewers: chad, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7014 Differential Revision: https://secure.phabricator.com/D12047 --- resources/celerity/map.php | 22 +++++++++---------- .../view/ConpherenceDurableColumnView.php | 19 +++++++++++++--- src/view/page/PhabricatorStandardPageView.php | 4 +++- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index f1e5b10517..f3f91021ea 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' => '44100dc7', + 'rsrc/js/application/conpherence/behavior-durable-column.js' => '64fc1053', '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' => '44100dc7', + 'javelin-behavior-durable-column' => '64fc1053', 'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-fancy-datepicker' => 'c51ae228', 'javelin-behavior-global-drag-and-drop' => '07f199d8', @@ -1110,15 +1110,6 @@ 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', @@ -1266,6 +1257,15 @@ return array( 'javelin-dom', 'javelin-fx', ), + '64fc1053' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-scrollbar', + 'javelin-quicksand', + 'phabricator-keyboard-shortcut', + 'conpherence-thread-manager', + ), '6882e80a' => array( 'javelin-dom', ), diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php index c903b09835..ffb8f4fcba 100644 --- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php +++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php @@ -7,6 +7,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { private $selectedConpherence; private $transactions; private $visible; + private $initialLoad = false; public function setConpherences(array $conpherences) { assert_instances_of($conpherences, 'ConpherenceThread'); @@ -56,16 +57,29 @@ final class ConpherenceDurableColumnView extends AphrontTagView { return $this->visible; } + public function setInitialLoad($bool) { + $this->initialLoad = $bool; + return $this; + } + + public function getInitialLoad() { + return $this->initialLoad; + } + protected function getTagAttributes() { if ($this->getVisible()) { $style = null; } else { $style = 'display: none;'; } + $classes = array('conpherence-durable-column'); + if ($this->getInitialLoad()) { + $classes[] = 'loading'; + } return array( 'id' => 'conpherence-durable-column', - 'class' => 'conpherence-durable-column', + 'class' => implode(' ', $classes), 'style' => $style, 'sigil' => 'conpherence-durable-column', ); @@ -73,7 +87,6 @@ final class ConpherenceDurableColumnView extends AphrontTagView { protected function getTagContent() { $column_key = PhabricatorUserPreferences::PREFERENCE_CONPHERENCE_COLUMN; - require_celerity_resource('conpherence-durable-column-view'); require_celerity_resource('font-source-sans-pro'); Javelin::initBehavior( @@ -317,7 +330,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { private function buildTransactions() { $conpherence = $this->getSelectedConpherence(); if (!$conpherence) { - if (!$this->getVisible()) { + if (!$this->getVisible() || $this->getInitialLoad()) { return pht('Loading...'); } return array( diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index 9cf9ebb1ff..79a1a43b7c 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -160,6 +160,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { require_celerity_resource('phui-form-css'); require_celerity_resource('sprite-gradient-css'); require_celerity_resource('phabricator-standard-page-view'); + require_celerity_resource('conpherence-durable-column-view'); Javelin::initBehavior('workflow', array()); @@ -420,7 +421,8 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { $durable_column = id(new ConpherenceDurableColumnView()) ->setSelectedConpherence(null) ->setUser($user) - ->setVisible($is_visible); + ->setVisible($is_visible) + ->setInitialLoad(true); } Javelin::initBehavior('quicksand-blacklist', array(