Restore comments on Ponder answers

Summary:
Ref T3373. This is still pretty messy:

  - The JS bugs out a bit with multiple primary object PHIDs on a single page. I'll fix this in a followup.
  - The comment form itself is enormous, I'll restore some show/hide stuff in a followup.

Test Plan: Added answer comments in Ponder.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3373

Differential Revision: https://secure.phabricator.com/D6608
This commit is contained in:
epriestley
2013-07-28 17:40:11 -07:00
parent 946a5cd5ce
commit 4be9ccaea8
8 changed files with 144 additions and 29 deletions

View File

@@ -14,18 +14,24 @@ JX.behavior('phabricator-transaction-comment-form', function(config) {
JX.DOM.listen(form, 'willSubmit', null, function (e) {
e.kill();
var preview = JX.$(config.panelID);
preview.style.opacity = 0.5;
if (config.showPreview) {
var preview = JX.$(config.panelID);
preview.style.opacity = 0.5;
}
});
JX.DOM.listen(form, 'willClear', null, function(e) {
JX.$(config.commentID).value = '';
var preview = JX.$(config.panelID);
new JX.FX(preview)
.setDuration(500)
.then(function () {
new JX.FX(preview).setDuration(1000).start({opacity: [0, 1]});
})
.start({opacity: [0.5, 0]});
if (config.showPreview) {
var preview = JX.$(config.panelID);
new JX.FX(preview)
.setDuration(500)
.then(function () {
new JX.FX(preview).setDuration(1000).start({opacity: [0, 1]});
})
.start({opacity: [0.5, 0]});
}
});
var getdata = function() {
@@ -55,18 +61,20 @@ JX.behavior('phabricator-transaction-comment-form', function(config) {
}
};
var request = new JX.PhabricatorShapedRequest(
config.actionURI,
onresponse,
getdata);
var trigger = JX.bind(request, request.trigger);
JX.DOM.listen(form, 'keydown', null, trigger);
var always_trigger = function() {
new JX.Request(config.actionURI, onresponse)
.setData(getdata())
.send();
};
JX.DOM.listen(form, 'shouldRefresh', null, always_trigger);
if (config.showPreview) {
var request = new JX.PhabricatorShapedRequest(
config.actionURI,
onresponse,
getdata);
var trigger = JX.bind(request, request.trigger);
JX.DOM.listen(form, 'keydown', null, trigger);
var always_trigger = function() {
new JX.Request(config.actionURI, onresponse)
.setData(getdata())
.send();
};
JX.DOM.listen(form, 'shouldRefresh', null, always_trigger);
request.start();
request.start();
}
});