Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/PhabricatorInlineCommentController.php
| Show First 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | switch ($op) { | ||||
| $view = $this->buildScaffoldForView($edit_dialog); | $view = $this->buildScaffoldForView($edit_dialog); | ||||
| return $this->newInlineResponse($inline, $view); | return $this->newInlineResponse($inline, $view); | ||||
| case 'cancel': | case 'cancel': | ||||
| $inline = $this->loadCommentForEdit($this->getCommentID()); | $inline = $this->loadCommentForEdit($this->getCommentID()); | ||||
| $inline->setIsEditing(false); | $inline->setIsEditing(false); | ||||
| // If the user uses "Undo" to get into an edited state ("AB"), then | |||||
| // clicks cancel to return to the previous state ("A"), we also want | |||||
| // to set the stored state back to "A". | |||||
| $text = $this->getCommentText(); | |||||
| if (strlen($text)) { | |||||
| $inline->setContent($text); | |||||
| } | |||||
| $content = $inline->getContent(); | $content = $inline->getContent(); | ||||
| if (!strlen($content)) { | if (!strlen($content)) { | ||||
| $this->deleteComment($inline); | $this->deleteComment($inline); | ||||
| } else { | } else { | ||||
| $this->saveComment($inline); | $this->saveComment($inline); | ||||
| } | } | ||||
| return $this->buildEmptyResponse(); | return $this->buildEmptyResponse(); | ||||
| ▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines | |||||