mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-08 02:19:34 +01:00
[differential] Prevent un-closeable overlay
Summary: Currently if I go to leave an inline comment and then decide against it and hit <tab>-<enter>, the inline comment edit dialog closes but the overlay doesn't disappear due to a JS error around trying to access the markup property of null. This fixes that by setting the payload to an array with empty markup so that the JS works and the overlay disappears. Test Plan: clicked on the line number column, then pressed ok and confirmed the dialog closed, the overlay disappeared and there were no JS errors. also tested that for clicking the reply link and when editing an existing inline comment. Reviewed By: aran Reviewers: epriestley, aran CC: aran, bh Revert Plan: OK Differential Revision: 154
This commit is contained in:
parent
a6c770217d
commit
15e71e9bf4
1 changed files with 4 additions and 4 deletions
|
@ -70,7 +70,7 @@ class DifferentialInlineCommentEditController extends DifferentialController {
|
|||
|
||||
if ($request->isFormPost()) {
|
||||
$inline->delete();
|
||||
return $this->buildDeletedResponse();
|
||||
return $this->buildEmptyResponse();
|
||||
}
|
||||
|
||||
$edit_dialog->setTitle('Really delete this comment?');
|
||||
|
@ -95,7 +95,7 @@ class DifferentialInlineCommentEditController extends DifferentialController {
|
|||
$on_right);
|
||||
} else {
|
||||
$inline->delete();
|
||||
return $this->buildDeletedResponse();
|
||||
return $this->buildEmptyResponse();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ class DifferentialInlineCommentEditController extends DifferentialController {
|
|||
case 'create':
|
||||
|
||||
if (!$request->isFormPost() || !strlen($text)) {
|
||||
return new AphrontAjaxResponse();
|
||||
return $this->buildEmptyResponse();
|
||||
}
|
||||
|
||||
$inline = id(new DifferentialInlineComment())
|
||||
|
@ -173,7 +173,7 @@ class DifferentialInlineCommentEditController extends DifferentialController {
|
|||
));
|
||||
}
|
||||
|
||||
private function buildDeletedResponse() {
|
||||
private function buildEmptyResponse() {
|
||||
return id(new AphrontAjaxResponse())
|
||||
->setContent(
|
||||
array(
|
||||
|
|
Loading…
Add table
Reference in a new issue