Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/pages/views/diffViewerPageView.js reviewboard/static/rb/js/views/floatingBannerView.js reviewboard/static/rb/css/pages/diffviewer.less Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/pages/views/diffViewerPageView.js reviewboard/static/rb/js/views/floatingBannerView.js reviewboard/static/rb/css/pages/diffviewer.less
[WIP] Added a floating banner to the diff view
Review Request #8714 - Created Feb. 4, 2017 and discarded
We currently have to scroll all the way to the top if we want to be navigated to a
specific diff file.
I added a floating banner to the diff view that sticks to the top of the page when
the user has scrolled down. I added text to the banner: "Navigate: ", as well as
a dropdown button. This button is a list of all diff file names. The current
state displays the first diff filename on default, and each diff filename
when hovering over the arrow. The default filename is duplicated at the
moment. I also added scrolling functionality when the button gets clicked.
This will take the user's view to the anchor tag of the selected diff file.
Screenshots of the current state of my project:
I have tested the floating banner on the testing server using dummy diff files
created by RB Tools.
Correct me if I'm wrong, but: I don't understand why you're attaching the diff-banner to the template meant for each file's diff in the diff page.
On line 266,
$diffsis assigned to the empty
divwith the id
$diffs = $('#diffs').empty();
Then on line 270, a function begins that executes for each file:
In this function, the line adding the template is here (line 275):
So it appears that the code adds the template multiple times to the
divwith the id
I don't think you want to make the banner appear multiple times, just once. Perhaps there is a better place to add the banner, like