Page MenuHomePhabricator

D21187.diff
No OneTemporary

D21187.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -13,7 +13,7 @@
'core.pkg.js' => '632fb8f5',
'dark-console.pkg.js' => '187792c2',
'differential.pkg.css' => '2d70b7b9',
- 'differential.pkg.js' => 'b289f75d',
+ 'differential.pkg.js' => 'b35de23a',
'diffusion.pkg.css' => '42c75c37',
'diffusion.pkg.js' => 'a98c0bf7',
'maniphest.pkg.css' => '35995d6d',
@@ -381,7 +381,7 @@
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8',
'rsrc/js/application/diff/DiffChangeset.js' => '9a713ba5',
'rsrc/js/application/diff/DiffChangesetList.js' => '10726e6a',
- 'rsrc/js/application/diff/DiffInline.js' => '7b0bdd6d',
+ 'rsrc/js/application/diff/DiffInline.js' => '02791ed9',
'rsrc/js/application/diff/DiffPathView.js' => '8207abf9',
'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b',
'rsrc/js/application/diff/behavior-preview-link.js' => 'f51e9c17',
@@ -778,7 +778,7 @@
'phabricator-dashboard-css' => '5a205b9d',
'phabricator-diff-changeset' => '9a713ba5',
'phabricator-diff-changeset-list' => '10726e6a',
- 'phabricator-diff-inline' => '7b0bdd6d',
+ 'phabricator-diff-inline' => '02791ed9',
'phabricator-diff-path-view' => '8207abf9',
'phabricator-diff-tree-view' => '5d83623b',
'phabricator-drag-and-drop-file-upload' => '4370900d',
@@ -944,6 +944,9 @@
'javelin-leader',
'javelin-json',
),
+ '02791ed9' => array(
+ 'javelin-dom',
+ ),
'02cb4398' => array(
'javelin-behavior',
'javelin-dom',
@@ -1616,9 +1619,6 @@
'phabricator-drag-and-drop-file-upload',
'phabricator-textareautils',
),
- '7b0bdd6d' => array(
- 'javelin-dom',
- ),
'7b139193' => array(
'javelin-behavior',
'javelin-stratcom',
diff --git a/src/infrastructure/diff/PhabricatorInlineCommentController.php b/src/infrastructure/diff/PhabricatorInlineCommentController.php
--- a/src/infrastructure/diff/PhabricatorInlineCommentController.php
+++ b/src/infrastructure/diff/PhabricatorInlineCommentController.php
@@ -215,6 +215,19 @@
$view = $this->buildScaffoldForView($edit_dialog);
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 'reply':
default:
diff --git a/webroot/rsrc/js/application/diff/DiffInline.js b/webroot/rsrc/js/application/diff/DiffInline.js
--- a/webroot/rsrc/js/application/diff/DiffInline.js
+++ b/webroot/rsrc/js/application/diff/DiffInline.js
@@ -647,12 +647,25 @@
}
this.setEditing(false);
-
this.setInvisible(false);
+ var uri = this._getInlineURI();
+ var data = this._newRequestData('cancel');
+ var handler = JX.bind(this, this._onCancelResponse);
+
+ this.setLoading(true);
+
+ new JX.Request(uri, handler)
+ .setData(data)
+ .send();
+
this._didUpdate(true);
},
+ _onCancelResponse: function(response) {
+ this.setLoading(false);
+ },
+
_readText: function(row) {
var textarea;
try {

File Metadata

Mime Type
text/plain
Expires
Mon, May 20, 12:55 AM (2 w, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6275109
Default Alt Text
D21187.diff (3 KB)

Event Timeline