diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/assets/javascripts/single_file_diff.js | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/assets/javascripts/single_file_diff.js')
-rw-r--r-- | app/assets/javascripts/single_file_diff.js | 18 |
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); } } |