Commit c063ee5e authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'fix-diff-comments-bug' into 'master'

Fix diff comments inverted toggle bug

## What does this MR do?
Explicitly set the comments visibility toggle based on the `active` css class.

## Are there points in the code the reviewer needs to double check?
Shouldn't be

## Why was this MR needed?
Fixes existing UI bug

## What are the relevant issue numbers?
Closes #20898 

## Screenshots (if relevant)
Before:
![A1ccIDEWsI](/uploads/21175e2008ee4e00225c22afebd873aa/A1ccIDEWsI.gif)

After:
![jHoFp69mAK](/uploads/e85f429d60a4e56d588faec51cd8648a/jHoFp69mAK.gif)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5818
parents 20d46393 e45064e8
...@@ -91,6 +91,7 @@ v 8.11.0 (unreleased) ...@@ -91,6 +91,7 @@ v 8.11.0 (unreleased)
- Allow branch names ending with .json for graph and network page !5579 (winniehell) - Allow branch names ending with .json for graph and network page !5579 (winniehell)
- Add the `sprockets-es6` gem - Add the `sprockets-es6` gem
- Improve OAuth2 client documentation (muteor) - Improve OAuth2 client documentation (muteor)
- Fix diff comments inverted toggle bug (ClemMakesApps)
- Multiple trigger variables show in separate lines (Katarzyna Kobierska Ula Budziszewska) - Multiple trigger variables show in separate lines (Katarzyna Kobierska Ula Budziszewska)
- Profile requests when a header is passed - Profile requests when a header is passed
- Avoid calculation of line_code and position for _line partial when showing diff notes on discussion tab. - Avoid calculation of line_code and position for _line partial when showing diff notes on discussion tab.
......
...@@ -224,8 +224,11 @@ ...@@ -224,8 +224,11 @@
return $('.navbar-toggle').toggleClass('active'); return $('.navbar-toggle').toggleClass('active');
}); });
$body.on("click", ".js-toggle-diff-comments", function(e) { $body.on("click", ".js-toggle-diff-comments", function(e) {
$(this).toggleClass('active'); var $this = $(this);
$(this).closest(".diff-file").find(".notes_holder").toggle(); var showComments = $this.hasClass('active');
$this.toggleClass('active');
$this.closest(".diff-file").find(".notes_holder").toggle(showComments);
return e.preventDefault(); return e.preventDefault();
}); });
$document.off("click", '.js-confirm-danger'); $document.off("click", '.js-confirm-danger');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment