Fix cancelling of new diff comments.

Review Request #4037 — Created April 10, 2013 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

Fix cancelling of new diff comments.

Cancelling new diff comments was broken due to some of the earlier re-jiggering
of the destroy() callbacks. In the case of new diff comments when we don't have
a Review object, we were triggering the error callback instead of actually
destroying the object. I've fixed this case and added a big comment.

While I was doing this, I noticed that CommentEditor._updateFromComment was
being triggered during the cancel operation. I've made it remove that event
binding.
- Checked that cancelling the addition of a new diff comment with no existing
  Review would remove the comment flag.
- Checked that cancelling the addition of a new diff comment with an existing
  Review would remove the comment flag but leave the rest of the Review
  unaffected.
- Checked that cancelling a change to an existing diff comment left the existing
  comment text the same.