Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/PhabricatorInlineCommentController.php
Show First 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | switch ($op) { | ||||
} | } | ||||
$edit_dialog = $this->buildEditDialog($inline) | $edit_dialog = $this->buildEditDialog($inline) | ||||
->setTitle(pht('Edit Inline Comment')); | ->setTitle(pht('Edit Inline Comment')); | ||||
$view = $this->buildScaffoldForView($edit_dialog); | $view = $this->buildScaffoldForView($edit_dialog); | ||||
return $this->newInlineResponse($inline, $view); | return $this->newInlineResponse($inline, $view); | ||||
case 'cancel': | |||||
$inline = $this->loadCommentForEdit($this->getCommentID()); | |||||
$inline->setIsEditing(false); | |||||
$content = $inline->getContent(); | |||||
if (!strlen($content)) { | |||||
$this->deleteComment($inline); | |||||
} else { | |||||
$this->saveComment($inline); | |||||
} | |||||
return $this->buildEmptyResponse(); | |||||
case 'new': | case 'new': | ||||
case 'reply': | case 'reply': | ||||
default: | default: | ||||
// NOTE: We read the values from the client (the display values), not | // NOTE: We read the values from the client (the display values), not | ||||
// the values from the database (the original values) when replying. | // the values from the database (the original values) when replying. | ||||
// In particular, when replying to a ghost comment which was moved | // In particular, when replying to a ghost comment which was moved | ||||
// across diffs and then moved backward to the most recent visible | // across diffs and then moved backward to the most recent visible | ||||
// line, we want to reply on the display line (which exists), not on | // line, we want to reply on the display line (which exists), not on | ||||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |