1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Allow disabling JX.Workflow with keyboard modifier

Summary:
Ctrl+click opens the link to a new tab in most browsers.
Shift+click to a new window.
Alt+click or Meta+click downloads the target.

This diff respects these conventions by disabling JX.Workflow for these modifiers.

Test Plan:
Click Flag Task - inline dialog.
Ctrl+click Flag Task - new tab with standalone dialog.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2276
This commit is contained in:
vrana 2012-04-18 13:26:11 -07:00
parent 401ac19aa6
commit 3c22bebc9b
2 changed files with 24 additions and 20 deletions

View file

@ -1378,7 +1378,7 @@ celerity_register_resource_map(array(
), ),
'javelin-behavior-workflow' => 'javelin-behavior-workflow' =>
array( array(
'uri' => '/res/079f49c3/rsrc/js/application/core/behavior-workflow.js', 'uri' => '/res/ce154288/rsrc/js/application/core/behavior-workflow.js',
'type' => 'js', 'type' => 'js',
'requires' => 'requires' =>
array( array(
@ -2446,7 +2446,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/9c4e265b/core.pkg.css', 'uri' => '/res/pkg/9c4e265b/core.pkg.css',
'type' => 'css', 'type' => 'css',
), ),
'c6c80d56' => 'ba0a3c7e' =>
array( array(
'name' => 'core.pkg.js', 'name' => 'core.pkg.js',
'symbols' => 'symbols' =>
@ -2469,7 +2469,7 @@ celerity_register_resource_map(array(
15 => 'javelin-behavior-phabricator-tooltips', 15 => 'javelin-behavior-phabricator-tooltips',
16 => 'phabricator-prefab', 16 => 'phabricator-prefab',
), ),
'uri' => '/res/pkg/c6c80d56/core.pkg.js', 'uri' => '/res/pkg/ba0a3c7e/core.pkg.js',
'type' => 'js', 'type' => 'js',
), ),
'1138d3d1' => '1138d3d1' =>
@ -2641,7 +2641,7 @@ celerity_register_resource_map(array(
'javelin-behavior-aphront-basic-tokenizer' => '97f65640', 'javelin-behavior-aphront-basic-tokenizer' => '97f65640',
'javelin-behavior-aphront-drag-and-drop' => 'e4ddcab5', 'javelin-behavior-aphront-drag-and-drop' => 'e4ddcab5',
'javelin-behavior-aphront-drag-and-drop-textarea' => 'e4ddcab5', 'javelin-behavior-aphront-drag-and-drop-textarea' => 'e4ddcab5',
'javelin-behavior-aphront-form-disable-on-submit' => 'c6c80d56', 'javelin-behavior-aphront-form-disable-on-submit' => 'ba0a3c7e',
'javelin-behavior-audit-preview' => '5e68be89', 'javelin-behavior-audit-preview' => '5e68be89',
'javelin-behavior-buoyant' => 'e4ddcab5', 'javelin-behavior-buoyant' => 'e4ddcab5',
'javelin-behavior-differential-accept-with-errors' => 'e4ddcab5', 'javelin-behavior-differential-accept-with-errors' => 'e4ddcab5',
@ -2661,20 +2661,20 @@ celerity_register_resource_map(array(
'javelin-behavior-maniphest-transaction-controls' => '7707de41', 'javelin-behavior-maniphest-transaction-controls' => '7707de41',
'javelin-behavior-maniphest-transaction-expand' => '7707de41', 'javelin-behavior-maniphest-transaction-expand' => '7707de41',
'javelin-behavior-maniphest-transaction-preview' => '7707de41', 'javelin-behavior-maniphest-transaction-preview' => '7707de41',
'javelin-behavior-phabricator-autofocus' => 'c6c80d56', 'javelin-behavior-phabricator-autofocus' => 'ba0a3c7e',
'javelin-behavior-phabricator-keyboard-shortcuts' => 'c6c80d56', 'javelin-behavior-phabricator-keyboard-shortcuts' => 'ba0a3c7e',
'javelin-behavior-phabricator-object-selector' => 'e4ddcab5', 'javelin-behavior-phabricator-object-selector' => 'e4ddcab5',
'javelin-behavior-phabricator-oncopy' => 'c6c80d56', 'javelin-behavior-phabricator-oncopy' => 'ba0a3c7e',
'javelin-behavior-phabricator-tooltips' => 'c6c80d56', 'javelin-behavior-phabricator-tooltips' => 'ba0a3c7e',
'javelin-behavior-phabricator-watch-anchor' => 'c6c80d56', 'javelin-behavior-phabricator-watch-anchor' => 'ba0a3c7e',
'javelin-behavior-refresh-csrf' => 'c6c80d56', 'javelin-behavior-refresh-csrf' => 'ba0a3c7e',
'javelin-behavior-repository-crossreference' => 'e4ddcab5', 'javelin-behavior-repository-crossreference' => 'e4ddcab5',
'javelin-behavior-workflow' => 'c6c80d56', 'javelin-behavior-workflow' => 'ba0a3c7e',
'javelin-dom' => '8a5de8a3', 'javelin-dom' => '8a5de8a3',
'javelin-event' => '8a5de8a3', 'javelin-event' => '8a5de8a3',
'javelin-install' => '8a5de8a3', 'javelin-install' => '8a5de8a3',
'javelin-json' => '8a5de8a3', 'javelin-json' => '8a5de8a3',
'javelin-mask' => 'c6c80d56', 'javelin-mask' => 'ba0a3c7e',
'javelin-request' => '8a5de8a3', 'javelin-request' => '8a5de8a3',
'javelin-stratcom' => '8a5de8a3', 'javelin-stratcom' => '8a5de8a3',
'javelin-tokenizer' => '97f65640', 'javelin-tokenizer' => '97f65640',
@ -2686,7 +2686,7 @@ celerity_register_resource_map(array(
'javelin-uri' => '8a5de8a3', 'javelin-uri' => '8a5de8a3',
'javelin-util' => '8a5de8a3', 'javelin-util' => '8a5de8a3',
'javelin-vector' => '8a5de8a3', 'javelin-vector' => '8a5de8a3',
'javelin-workflow' => 'c6c80d56', 'javelin-workflow' => 'ba0a3c7e',
'maniphest-task-summary-css' => '7839ae2d', 'maniphest-task-summary-css' => '7839ae2d',
'maniphest-transaction-detail-css' => '7839ae2d', 'maniphest-transaction-detail-css' => '7839ae2d',
'phabricator-app-buttons-css' => '9c4e265b', 'phabricator-app-buttons-css' => '9c4e265b',
@ -2695,20 +2695,20 @@ celerity_register_resource_map(array(
'phabricator-core-css' => '9c4e265b', 'phabricator-core-css' => '9c4e265b',
'phabricator-directory-css' => '9c4e265b', 'phabricator-directory-css' => '9c4e265b',
'phabricator-drag-and-drop-file-upload' => 'e4ddcab5', 'phabricator-drag-and-drop-file-upload' => 'e4ddcab5',
'phabricator-dropdown-menu' => 'c6c80d56', 'phabricator-dropdown-menu' => 'ba0a3c7e',
'phabricator-flag-css' => '9c4e265b', 'phabricator-flag-css' => '9c4e265b',
'phabricator-jump-nav' => '9c4e265b', 'phabricator-jump-nav' => '9c4e265b',
'phabricator-keyboard-shortcut' => 'c6c80d56', 'phabricator-keyboard-shortcut' => 'ba0a3c7e',
'phabricator-keyboard-shortcut-manager' => 'c6c80d56', 'phabricator-keyboard-shortcut-manager' => 'ba0a3c7e',
'phabricator-menu-item' => 'c6c80d56', 'phabricator-menu-item' => 'ba0a3c7e',
'phabricator-object-selector-css' => '1138d3d1', 'phabricator-object-selector-css' => '1138d3d1',
'phabricator-paste-file-upload' => 'c6c80d56', 'phabricator-paste-file-upload' => 'ba0a3c7e',
'phabricator-prefab' => 'c6c80d56', 'phabricator-prefab' => 'ba0a3c7e',
'phabricator-project-tag-css' => '7839ae2d', 'phabricator-project-tag-css' => '7839ae2d',
'phabricator-remarkup-css' => '9c4e265b', 'phabricator-remarkup-css' => '9c4e265b',
'phabricator-shaped-request' => 'e4ddcab5', 'phabricator-shaped-request' => 'e4ddcab5',
'phabricator-standard-page-view' => '9c4e265b', 'phabricator-standard-page-view' => '9c4e265b',
'phabricator-tooltip' => 'c6c80d56', 'phabricator-tooltip' => 'ba0a3c7e',
'phabricator-transaction-view-css' => '9c4e265b', 'phabricator-transaction-view-css' => '9c4e265b',
'syntax-highlighting-css' => '9c4e265b', 'syntax-highlighting-css' => '9c4e265b',
), ),

View file

@ -29,6 +29,10 @@ JX.behavior('workflow', function() {
if (e.getNode('workflow') !== e.getTarget()) { if (e.getNode('workflow') !== e.getTarget()) {
return; return;
} }
var raw = e.getRawEvent();
if (raw.altKey || raw.ctrlKey || raw.metaKey || raw.shiftKey) {
return;
}
e.prevent(); e.prevent();
JX.Workflow.newFromLink(e.getTarget()).start(); JX.Workflow.newFromLink(e.getTarget()).start();
}); });