1
0
Fork 0
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:
bhiller 2011-04-20 01:58:05 -07:00
parent a6c770217d
commit 15e71e9bf4

View file

@ -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(