Fish Trophy

chipx86 got a fish trophy!

Fish Trophy

Move the review banner code out into a DraftReviewBannerView.

Review Request #4114 — Created May 8, 2013 and submitted

Information

Review Board
master

Reviewers

Move the review banner code out into a DraftReviewBannerView.

DraftReviewBannerView handles showing/hiding the banner in response to
events on the draft review, and handles the buttons on the banner.

DraftReviewBannerView is a singleton. It's created once up-front.
Callers can access the instance through
RB.DraftReviewBannerView.instance in order to show or hide the banner.
Manually tested all buttons, and various events that show the banner.

Unit tests pass.
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/views/abstractCommentBlockView.js
        reviewboard/templates/js/tests.html
        reviewboard/static/rb/js/views/draftReviewBannerView.js
        reviewboard/static/rb/js/views/tests/draftReviewBannerViewTests.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
        reviewboard/static/rb/js/diffviewer.js
        reviewboard/static/rb/js/reviews.js
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/static/rb/js/views/draftReviewBannerView.js (Diff revision 1)
     
     
     
     
     
     
    So the more I encounter this sort of thing, the more I think it should be:
    
    this.$el
        .slideDown();
    this.$el.find('.banner')
        .hide()
        .slideDown();
    1. I don't know. Either works. It's designed for this kind of thing though. If you need to go back a step in the chain, you just use end().
    2. I guess keep it as-is, but I may decide later on that I prefer the other one enough to raise a stink.
    3. I'll go ahead and change it and submit, if you're otherwise happy with the change.
    4. Yep, ship it.
  3. 
      
chipx86
Review request changed
Status:
Completed