From b292c29dc36514dd05166aeb3cdf52f1f1e262d9 Mon Sep 17 00:00:00 2001 From: lkassianik Date: Tue, 26 May 2015 11:27:51 -0700 Subject: [PATCH] Decouple date and time input classes on AphrontFormDateControl's so that disabling time doesn't disable date. Summary: Fixes T8319, Decouple date and time input classes on AphrontFormDateControl's so that disabling time doesn't disable date. Test Plan: Create new event, make it all day, time input should be hidden, but not date input. Reviewers: chad, #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8319 Differential Revision: https://secure.phabricator.com/D13021 --- resources/celerity/map.php | 24 +++++++++---------- .../form/control/AphrontFormDateControl.php | 8 +++---- webroot/rsrc/css/phui/phui-form-view.css | 10 ++++---- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index e093be5ae8..2989303d4e 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => '439658b5', + 'core.pkg.css' => '4e7df908', 'core.pkg.js' => '328799d0', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => 'bb338e4b', @@ -134,7 +134,7 @@ return array( 'rsrc/css/phui/phui-document.css' => '94d5dcd8', 'rsrc/css/phui/phui-feed-story.css' => 'c9f3a0b5', 'rsrc/css/phui/phui-fontkit.css' => 'dd8ddf27', - 'rsrc/css/phui/phui-form-view.css' => '79793450', + 'rsrc/css/phui/phui-form-view.css' => '808329f2', 'rsrc/css/phui/phui-form.css' => 'f535f938', 'rsrc/css/phui/phui-header-view.css' => '75aaf372', 'rsrc/css/phui/phui-icon.css' => 'bc766998', @@ -443,7 +443,7 @@ return array( 'rsrc/js/core/behavior-device.js' => 'a205cf28', 'rsrc/js/core/behavior-drag-and-drop-textarea.js' => '6d49590e', 'rsrc/js/core/behavior-error-log.js' => '6882e80a', - 'rsrc/js/core/behavior-fancy-datepicker.js' => '5c0f680f', + 'rsrc/js/core/behavior-fancy-datepicker.js' => '510b5809', 'rsrc/js/core/behavior-file-tree.js' => '88236f00', 'rsrc/js/core/behavior-form.js' => '5c54cbf3', 'rsrc/js/core/behavior-gesture.js' => '3ab51e2c', @@ -576,7 +576,7 @@ return array( 'javelin-behavior-durable-column' => '16c695bf', 'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-event-all-day' => '38dcf3c8', - 'javelin-behavior-fancy-datepicker' => '5c0f680f', + 'javelin-behavior-fancy-datepicker' => '510b5809', 'javelin-behavior-global-drag-and-drop' => 'c8e57404', 'javelin-behavior-herald-rule-editor' => '7ebaeed3', 'javelin-behavior-high-security-warning' => 'a464fe03', @@ -776,7 +776,7 @@ return array( 'phui-font-icon-base-css' => '3dad2ae3', 'phui-fontkit-css' => 'dd8ddf27', 'phui-form-css' => 'f535f938', - 'phui-form-view-css' => '79793450', + 'phui-form-view-css' => '808329f2', 'phui-header-view-css' => '75aaf372', 'phui-icon-view-css' => 'bc766998', 'phui-image-mask-css' => '5a8b09c8', @@ -1167,6 +1167,13 @@ return array( 'javelin-typeahead-source', 'javelin-util', ), + '510b5809' => array( + 'javelin-behavior', + 'javelin-util', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-vector', + ), '519705ea' => array( 'javelin-install', 'javelin-dom', @@ -1234,13 +1241,6 @@ return array( 'javelin-uri', 'javelin-routable', ), - '5c0f680f' => array( - 'javelin-behavior', - 'javelin-util', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-vector', - ), '5c54cbf3' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/src/view/form/control/AphrontFormDateControl.php b/src/view/form/control/AphrontFormDateControl.php index ca6d87b26c..ac026d410b 100644 --- a/src/view/form/control/AphrontFormDateControl.php +++ b/src/view/form/control/AphrontFormDateControl.php @@ -184,14 +184,14 @@ final class AphrontFormDateControl extends AphrontFormControl { 'sigil' => 'date-input', 'value' => $this->getDateInputValue(), 'type' => 'text', - 'class' => 'aphront-form-date-time-input', + 'class' => 'aphront-form-date-input', ), ''); $date_div = javelin_tag( 'div', array( - 'class' => 'aphront-form-date-time-input-container', + 'class' => 'aphront-form-date-input-container', ), $date_sel); @@ -225,7 +225,7 @@ final class AphrontFormDateControl extends AphrontFormControl { 'sigil' => 'time-input', 'value' => $this->getTimeInputValue(), 'type' => 'text', - 'class' => 'aphront-form-date-time-input', + 'class' => 'aphront-form-time-input', ), ''); @@ -233,7 +233,7 @@ final class AphrontFormDateControl extends AphrontFormControl { 'div', array( 'id' => $time_id, - 'class' => 'aphront-form-date-time-input-container', + 'class' => 'aphront-form-time-input-container', ), $time_sel); diff --git a/webroot/rsrc/css/phui/phui-form-view.css b/webroot/rsrc/css/phui/phui-form-view.css index 2600de81ac..1cd34f4f22 100644 --- a/webroot/rsrc/css/phui/phui-form-view.css +++ b/webroot/rsrc/css/phui/phui-form-view.css @@ -334,17 +334,19 @@ table.aphront-form-control-checkbox-layout th { font-size: 16px; } -.aphront-form-date-container .aphront-form-date-time-input-container { +.aphront-form-date-container .aphront-form-time-input-container, +.aphront-form-date-container .aphront-form-date-input-container { position: relative; display: inline-block; width: 7em; } -.aphront-form-date-container input.aphront-form-date-time-input { +.aphront-form-date-container input.aphront-form-time-input, +.aphront-form-date-container input.aphront-form-date-input { width: 7em; } -.aphront-form-date-time-input-container div.jx-typeahead-results a.jx-result { +.aphront-form-time-input-container div.jx-typeahead-results a.jx-result { border: none; } @@ -470,7 +472,7 @@ properly, and submit values. */ opacity: 0.5; } -.aphront-form-date-container.no-time .aphront-form-date-time-input{ +.aphront-form-date-container.no-time .aphront-form-time-input{ display: none; }