Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-27 15:09:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-27 15:09:14 +0300
commit95ff19a65c5236863e4c7c7e198bfc1e2fa70f07 (patch)
treee543a0b23941611b93a7d435b7644eafcdd8cbeb /app/assets/javascripts/single_file_diff.js
parent2df573afed782aebce8c020d92b42e9da7d2868e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/single_file_diff.js')
-rw-r--r--app/assets/javascripts/single_file_diff.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/app/assets/javascripts/single_file_diff.js b/app/assets/javascripts/single_file_diff.js
index 3492f19c996..f751df6367e 100644
--- a/app/assets/javascripts/single_file_diff.js
+++ b/app/assets/javascripts/single_file_diff.js
@@ -23,7 +23,8 @@ export default class SingleFileDiff {
this.file = file;
this.toggleDiff = this.toggleDiff.bind(this);
this.content = $('.diff-content', this.file);
- this.$toggleIcon = $('.diff-toggle-caret', this.file);
+ this.$chevronRightIcon = $('.diff-toggle-caret .chevron-right', this.file);
+ this.$chevronDownIcon = $('.diff-toggle-caret .chevron-down', this.file);
this.diffForPath = this.content.find('[data-diff-for-path]').data('diffForPath');
this.isOpen = !this.diffForPath;
if (this.diffForPath) {
@@ -34,13 +35,13 @@ export default class SingleFileDiff {
.hide();
this.content = null;
this.collapsedContent.after(this.loadingContent);
- this.$toggleIcon.addClass('fa-caret-right');
+ this.$chevronRightIcon.removeClass('gl-display-none');
} else {
this.collapsedContent = $(WRAPPER)
.html(COLLAPSED_HTML)
.hide();
this.content.after(this.collapsedContent);
- this.$toggleIcon.addClass('fa-caret-down');
+ this.$chevronDownIcon.removeClass('gl-display-none');
}
$('.js-file-title, .click-to-expand', this.file).on('click', e => {
@@ -52,20 +53,23 @@ export default class SingleFileDiff {
if (
!$target.hasClass('js-file-title') &&
!$target.hasClass('click-to-expand') &&
- !$target.hasClass('diff-toggle-caret')
+ !$target.closest('.diff-toggle-caret').length > 0
)
return;
this.isOpen = !this.isOpen;
if (!this.isOpen && !this.hasError) {
this.content.hide();
- this.$toggleIcon.addClass('fa-caret-right').removeClass('fa-caret-down');
+ this.$chevronRightIcon.removeClass('gl-display-none');
+ this.$chevronDownIcon.addClass('gl-display-none');
this.collapsedContent.show();
} else if (this.content) {
this.collapsedContent.hide();
this.content.show();
- this.$toggleIcon.addClass('fa-caret-down').removeClass('fa-caret-right');
+ this.$chevronDownIcon.removeClass('gl-display-none');
+ this.$chevronRightIcon.addClass('gl-display-none');
} else {
- this.$toggleIcon.addClass('fa-caret-down').removeClass('fa-caret-right');
+ this.$chevronDownIcon.removeClass('gl-display-none');
+ this.$chevronRightIcon.addClass('gl-display-none');
return this.getContentHTML(cb);
}
}