1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Fix the "x" link in tokenizer tokens incorrectly closing dialogs

Summary:
See <https://discourse.phabricator-community.org/t/removing-tags-or-subscribers-from-a-maniphest-modal-causes-the-modal-to-close/2874>.

My Javascript is rusty: `'' + null == 'null'`. Same for `undefined`. Use an explicit typecheck instead.

Test Plan: Clicked the "x" in a tokenizer token in a dialog, saw the token removed instead of the dialog closed.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20623
This commit is contained in:
epriestley 2019-06-28 08:40:10 -07:00
parent 159fd44203
commit d6dc5d8e68
2 changed files with 19 additions and 15 deletions

View file

@ -10,7 +10,7 @@ return array(
'conpherence.pkg.css' => '3c8a0668',
'conpherence.pkg.js' => '020aebcf',
'core.pkg.css' => 'af983028',
'core.pkg.js' => '8225dc58',
'core.pkg.js' => '5a792749',
'differential.pkg.css' => '8d8360fb',
'differential.pkg.js' => '67e02996',
'diffusion.pkg.css' => '42c75c37',
@ -253,7 +253,7 @@ return array(
'rsrc/externals/javelin/lib/URI.js' => '2e255291',
'rsrc/externals/javelin/lib/Vector.js' => 'e9c80beb',
'rsrc/externals/javelin/lib/WebSocket.js' => 'fdc13e4e',
'rsrc/externals/javelin/lib/Workflow.js' => '851f642d',
'rsrc/externals/javelin/lib/Workflow.js' => '445e21a8',
'rsrc/externals/javelin/lib/__tests__/Cookie.js' => 'ca686f71',
'rsrc/externals/javelin/lib/__tests__/DOM.js' => '4566e249',
'rsrc/externals/javelin/lib/__tests__/JSON.js' => '710377ae',
@ -752,7 +752,7 @@ return array(
'javelin-workboard-header' => '111bfd2d',
'javelin-workboard-header-template' => 'ebe83a6b',
'javelin-workboard-order-template' => '03e8891f',
'javelin-workflow' => '851f642d',
'javelin-workflow' => '445e21a8',
'maniphest-report-css' => '3d53188b',
'maniphest-task-edit-css' => '272daa84',
'maniphest-task-summary-css' => '61d1667e',
@ -1294,6 +1294,17 @@ return array(
'43bc9360' => array(
'javelin-install',
),
'445e21a8' => array(
'javelin-stratcom',
'javelin-request',
'javelin-dom',
'javelin-vector',
'javelin-install',
'javelin-util',
'javelin-mask',
'javelin-uri',
'javelin-routable',
),
'46116c01' => array(
'javelin-request',
'javelin-behavior',
@ -1607,17 +1618,6 @@ return array(
'javelin-resource',
'javelin-routable',
),
'851f642d' => array(
'javelin-stratcom',
'javelin-request',
'javelin-dom',
'javelin-vector',
'javelin-install',
'javelin-util',
'javelin-mask',
'javelin-uri',
'javelin-routable',
),
'87428eb2' => array(
'javelin-behavior',
'javelin-diffusion-locate-file-source',

View file

@ -104,7 +104,11 @@ JX.install('Workflow', {
var link = event.getNode('tag:a');
// If the link is an anchor, or does not go anywhere, ignore the event.
var href = '' + link.getAttribute('href');
var href = link.getAttribute('href');
if (typeof href !== 'string') {
return;
}
if (!href.length || href[0] === '#') {
return;
}