From cf54194ef56c36d25f15992fb1a2c7008ff0c23a Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 16 Mar 2015 06:44:07 -0700 Subject: [PATCH] Improve chat column behavior for newline in empty text box Summary: Ref T7538. I got this half correct but not fully correct: when you press enter in an empty text box, do nothing (instead of: sending an empty message, or writing a literal newline). Test Plan: Hit enter in empty chat column box. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T7538 Differential Revision: https://secure.phabricator.com/D12089 --- resources/celerity/map.php | 24 +++++++++---------- .../conpherence/behavior-durable-column.js | 4 ++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 5824da4244..7958972924 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' => 'cff1902b', - 'rsrc/js/application/conpherence/behavior-durable-column.js' => '332ac18d', + 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'e975bd12', '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', @@ -583,7 +583,7 @@ return array( 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 'javelin-behavior-diffusion-pull-lastmodified' => '2b228192', 'javelin-behavior-doorkeeper-tag' => 'e5822781', - 'javelin-behavior-durable-column' => '332ac18d', + 'javelin-behavior-durable-column' => 'e975bd12', 'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-fancy-datepicker' => 'c51ae228', 'javelin-behavior-global-drag-and-drop' => 'bbdf75ca', @@ -1054,16 +1054,6 @@ return array( '331b1611' => array( 'javelin-install', ), - '332ac18d' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-behavior-device', - 'javelin-scrollbar', - 'javelin-quicksand', - 'phabricator-keyboard-shortcut', - 'conpherence-thread-manager', - ), '3ab51e2c' => array( 'javelin-behavior', 'javelin-behavior-device', @@ -1903,6 +1893,16 @@ return array( 'javelin-dom', 'phabricator-draggable-list', ), + 'e975bd12' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-behavior-device', + 'javelin-scrollbar', + 'javelin-quicksand', + 'phabricator-keyboard-shortcut', + 'conpherence-thread-manager', + ), 'ea681761' => array( 'javelin-behavior', 'javelin-aphlict', diff --git a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js index 346df6a3e0..a452ddfdca 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js +++ b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js @@ -296,6 +296,10 @@ JX.behavior('durable-column', function(config, statics) { return; } + // From here on, interpret this as a "send" action, not a literal + // newline. + e.kill(); + var textarea = _getColumnTextareaNode(); if (!textarea.value.length) { // If there's no text, don't try to submit the form.