MozReview: trigger a jquery JS event when an issue status changes (bug 1253552) r?davidwalsh draft
authorbyron jones <glob@mozilla.com>
Mon, 11 Jul 2016 22:46:09 +0800
changeset 26 39869ee560be839d248aab666c01f77a197d4626
parent 25 5d84ec273f3abbfb464c5e38aac23a43ee198007
push idunknown
push userunknown
push dateunknown
reviewersdavidwalsh
bugs1253552
MozReview: trigger a jquery JS event when an issue status changes (bug 1253552) r?davidwalsh In order to update the commits table when an issue's status is changed, we need to trigger an event that we can listen for. MozReview-Commit-ID: 47vpnZl8DTD
reviewboard/reviewboard/static/rb/js/views/reviewBoxView.js
--- a/reviewboard/reviewboard/static/rb/js/views/reviewBoxView.js
+++ b/reviewboard/reviewboard/static/rb/js/views/reviewBoxView.js
@@ -218,16 +218,20 @@ RB.ReviewBoxView = RB.CollapsableBoxView
     _onIssueStatusChanged: function(issueStatus) {
         if (issueStatus === RB.BaseComment.STATE_OPEN) {
             this._openIssueCount++;
         } else {
             this._openIssueCount--;
         }
 
         this._updateLabels();
+
+        // MozReview: trigger a jquery js event so we can update
+        // the commits table when an issue status changes.
+        $(document).trigger('mr:issue_status_changed', this);
     },
 
     /*
      * Updates the Ship It and Fix It labels based on the open issue counts.
      *
      * If there are open issues, there will be a "Fix it!" label.
      *
      * If there's a Ship It, there will be a "Ship it!" label.