summaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js')
-rw-r--r--web_src/js/index.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index de9b99d4ef..aa9b3be004 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -2489,6 +2489,18 @@ function initIssueReferenceRepositorySearch() {
});
}
+function initFileViewToggle() {
+ $('.file-view-toggle').on('click', function() {
+ const $this = $(this);
+ $this.parent().children().removeClass('active');
+ $this.addClass('active');
+
+ const $target = $($this.data('toggle-selector'));
+ $target.parent().children().addClass('hide');
+ $target.removeClass('hide');
+ });
+}
+
function initLinkAccountView() {
const $lnkUserPage = $('.page-content.user.link-account');
if ($lnkUserPage.length === 0) {
@@ -2756,6 +2768,7 @@ $(document).ready(async () => {
initTableSort();
initNotificationsTable();
initPullRequestMergeInstruction();
+ initFileViewToggle();
initReleaseEditor();
initRelease();