mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
diffusion / differential - better handle case where no comment selected
Summary: Right now, if no comment is selected the JS executes and throws an exception. Instead, if nothing is selected just do nothing. Fixes T6107. Test Plan: opened up a commit in diffusion with an inline comment. pressed 'r' and saw no exceptions and nothing happen. pressed 'n' to select the next inline comment and then 'r' and it worked. opened up a commit in diffusion without any inline comments. pressed 'r' and saw no exceptions and nothing happen. opened up a diff in differential with an inline comment. pressed 'r' and saw no exceptons and nothing happened. pressed 'n' to select the next inline comment and then 'r' and it worked. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6107 Differential Revision: https://secure.phabricator.com/D10843
This commit is contained in:
parent
aeb3a12e13
commit
22551d106d
2 changed files with 13 additions and 9 deletions
|
@ -11,7 +11,7 @@ return array(
|
|||
'core.pkg.js' => 'cbdbd552',
|
||||
'darkconsole.pkg.js' => 'df001cab',
|
||||
'differential.pkg.css' => '8af45893',
|
||||
'differential.pkg.js' => '85cb2027',
|
||||
'differential.pkg.js' => '42c10e78',
|
||||
'diffusion.pkg.css' => '591664fa',
|
||||
'diffusion.pkg.js' => 'bfc0737b',
|
||||
'maniphest.pkg.css' => 'e34dfbec',
|
||||
|
@ -369,7 +369,7 @@ return array(
|
|||
'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1',
|
||||
'rsrc/js/application/differential/behavior-dropdown-menus.js' => '710f209e',
|
||||
'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '00861799',
|
||||
'rsrc/js/application/differential/behavior-keyboard-nav.js' => '8d199d97',
|
||||
'rsrc/js/application/differential/behavior-keyboard-nav.js' => '2c426492',
|
||||
'rsrc/js/application/differential/behavior-populate.js' => 'bdb3e4d0',
|
||||
'rsrc/js/application/differential/behavior-show-all-comments.js' => '7c273581',
|
||||
'rsrc/js/application/differential/behavior-show-field-details.js' => 'bba9eedf',
|
||||
|
@ -572,7 +572,7 @@ return array(
|
|||
'javelin-behavior-differential-dropdown-menus' => '710f209e',
|
||||
'javelin-behavior-differential-edit-inline-comments' => '00861799',
|
||||
'javelin-behavior-differential-feedback-preview' => '6932def3',
|
||||
'javelin-behavior-differential-keyboard-navigation' => '8d199d97',
|
||||
'javelin-behavior-differential-keyboard-navigation' => '2c426492',
|
||||
'javelin-behavior-differential-populate' => 'bdb3e4d0',
|
||||
'javelin-behavior-differential-show-field-details' => 'bba9eedf',
|
||||
'javelin-behavior-differential-show-more' => 'dd7e8ef5',
|
||||
|
@ -1009,6 +1009,12 @@ return array(
|
|||
'javelin-stratcom',
|
||||
'javelin-dom',
|
||||
),
|
||||
'2c426492' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
'javelin-stratcom',
|
||||
'phabricator-keyboard-shortcut',
|
||||
),
|
||||
'2fa810fc' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
@ -1416,12 +1422,6 @@ return array(
|
|||
'javelin-uri',
|
||||
'phabricator-file-upload',
|
||||
),
|
||||
'8d199d97' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
'javelin-stratcom',
|
||||
'phabricator-keyboard-shortcut',
|
||||
),
|
||||
'8ef9ab58' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
|
|
@ -242,6 +242,10 @@ JX.behavior('differential-keyboard-navigation', function(config) {
|
|||
|
||||
|
||||
function inline_op(node, op) {
|
||||
// nothing selected
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
if (!JX.DOM.scry(node, 'a', 'differential-inline-' + op)) {
|
||||
// No link for this operation, e.g. editing a comment you can't edit.
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue