Touch up PHP/JS interactions for inline comments

Summary:
Ref T1460. Overall:

  - Pass `objectOwnerPHID` consistently.
  - Pass viewer consistently.
  - Set the correct draft state for checkboxes on the client.

Test Plan:
  - Made inline comments in Differential.
  - Made inline comments in Diffusion.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T1460

Differential Revision: https://secure.phabricator.com/D12186
This commit is contained in:
epriestley
2015-03-27 17:08:31 -07:00
parent b560014577
commit a17542ab28
12 changed files with 141 additions and 82 deletions

View File

@@ -301,7 +301,7 @@ JX.install('DifferentialInlineCommentEditor', {
};
new JX.Workflow(this._uri, data)
.setHandler(JX.bind(this, function() {
.setHandler(JX.bind(this, function(r) {
checkbox.checked = !checkbox.checked;
var comment = JX.DOM.findAbove(
@@ -309,8 +309,7 @@ JX.install('DifferentialInlineCommentEditor', {
'div',
'differential-inline-comment');
JX.DOM.alterClass(comment, 'inline-is-done', !!checkbox.checked);
// TODO: Dynamically update the "inline-state-is-draft" class.
JX.DOM.alterClass(comment, 'inline-state-is-draft', r.draftState);
this._didUpdate();
}))