From 3069ef41662d916ea57d254b10491d6e852d8d46 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 1 Aug 2019 12:02:01 -0700 Subject: [PATCH] Prevent object titles in the "Object Attacher" dialog from triggering Quicksand "Close Dialog on Navigation" behavior Summary: Fixes T13363. Currently, these are genuine links which we intercept events for. Make them pseudolinks instead. Possible alternative approaches are: - Keep them as genuine links, but mark them as non-navigation links for Quicksand. (But: yuck, weird special case.) - Keep them as genuine links, and have the dialog handler `JX.Stratcom.pass()` to see if anything handles the event. (But: the "pass()" pattern generally feels bad.) "Tableaus" or whatever comes out of T10469 some day will probably break everything anyway? Test Plan: - Opened the "Edit Related Tasks... > Edit Subtasks" dialog. - Clicked task title links (not the "open in new window" icon, and not the "Select" button). - Before: Dialog (sometimes) closed abruptly. - After: Task is consistently selected as part of the attachment set. Maniphest Tasks: T13363 Differential Revision: https://secure.phabricator.com/D20693 --- resources/celerity/map.php | 18 +++++++++--------- .../rsrc/js/core/behavior-object-selector.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index ca09a081e5..9dc1d68fd9 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -12,7 +12,7 @@ return array( 'core.pkg.css' => 'af983028', 'core.pkg.js' => '73a06a9f', 'differential.pkg.css' => '8d8360fb', - 'differential.pkg.js' => '67e02996', + 'differential.pkg.js' => '0b037a4f', 'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.js' => 'a98c0bf7', 'maniphest.pkg.css' => '35995d6d', @@ -484,7 +484,7 @@ return array( 'rsrc/js/core/behavior-line-linker.js' => 'e15c8b1f', 'rsrc/js/core/behavior-linked-container.js' => '74446546', 'rsrc/js/core/behavior-more.js' => '506aa3f4', - 'rsrc/js/core/behavior-object-selector.js' => 'a4af0b4a', + 'rsrc/js/core/behavior-object-selector.js' => '98ef467f', 'rsrc/js/core/behavior-oncopy.js' => 'ff7b3f22', 'rsrc/js/core/behavior-phabricator-nav.js' => 'f166c949', 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => '2f80333f', @@ -645,7 +645,7 @@ return array( 'javelin-behavior-phabricator-line-linker' => 'e15c8b1f', 'javelin-behavior-phabricator-nav' => 'f166c949', 'javelin-behavior-phabricator-notification-example' => '29819b75', - 'javelin-behavior-phabricator-object-selector' => 'a4af0b4a', + 'javelin-behavior-phabricator-object-selector' => '98ef467f', 'javelin-behavior-phabricator-oncopy' => 'ff7b3f22', 'javelin-behavior-phabricator-remarkup-assist' => '2f80333f', 'javelin-behavior-phabricator-reveal-content' => 'b105a3a6', @@ -1730,6 +1730,12 @@ return array( 'javelin-dom', 'javelin-router', ), + '98ef467f' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-request', + 'javelin-util', + ), '9aae2b66' => array( 'javelin-install', 'javelin-util', @@ -1790,12 +1796,6 @@ return array( 'phui-button-css', 'phui-button-simple-css', ), - 'a4af0b4a' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-request', - 'javelin-util', - ), 'a5257c4e' => array( 'javelin-install', 'javelin-dom', diff --git a/webroot/rsrc/js/core/behavior-object-selector.js b/webroot/rsrc/js/core/behavior-object-selector.js index 722cfdd562..b28dac0926 100644 --- a/webroot/rsrc/js/core/behavior-object-selector.js +++ b/webroot/rsrc/js/core/behavior-object-selector.js @@ -132,7 +132,7 @@ JX.behavior('phabricator-object-selector', function(config) { var select_object_link = JX.$N( 'a', - {href: h.uri, sigil: 'object-attacher'}, + {href: '#', sigil: 'object-attacher'}, h.name); var select_object_button = JX.$N(