Add a Diff Viewer view for only the new file
Review Request #11226 — Created Oct. 16, 2020 and updated — Latest diff uploaded
The current diff viewer shows both the old and new view for every diff.
Sometimes, we want to just look at the new view and not the whole diff with
the existing code. Adding the feature to hide the old view and only show the
new view will allow users to have an uncluttered view.
We added a
[Show/Hide]toggle to the
revision-rowon the diff viewer. This
button will toggle between showing both views and only showing the new view.
The button toggles a
show-new-onlyclass which show or hide the old view with
display: noneproperty. If the line contain comments, the comment
flags are detached from the old view's column and appended to the new view's
column using jQuery's
appendTo()function, vice versa.
On show new onlyin
Tested following behaviour in browser:
- Added comments before toggling, able to view in both views
- Added comments after toggling, able to view in both views