aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2021-02-22 09:14:27 +0800
committerGitHub <noreply@github.com>2021-02-21 20:14:27 -0500
commit1ecdc55aff223048c9a469c38966378d785fbd31 (patch)
treecdcc35c06ad12b7dc419054ee51afae695c13a03 /web_src
parenta50ca283555e8c50fc56cbf035932ff612310598 (diff)
downloadgitea-1ecdc55aff223048c9a469c38966378d785fbd31.tar.gz
gitea-1ecdc55aff223048c9a469c38966378d785fbd31.zip
fix link account ui (#14763)
Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/index.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index f5e3c705e8..7bfe12e3ca 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -2397,6 +2397,33 @@ function initIssueReferenceRepositorySearch() {
});
}
+function initLinkAccountView() {
+ const $lnkUserPage = $('.page-content.user.link-account');
+ if ($lnkUserPage.length === 0) {
+ return false;
+ }
+
+ const $signinTab = $lnkUserPage.find('.item[data-tab="auth-link-signin-tab"]');
+ const $signUpTab = $lnkUserPage.find('.item[data-tab="auth-link-signup-tab"]');
+ const $signInView = $lnkUserPage.find('.tab[data-tab="auth-link-signin-tab"]');
+ const $signUpView = $lnkUserPage.find('.tab[data-tab="auth-link-signup-tab"]');
+
+ $signUpTab.on('click', () => {
+ $signinTab.removeClass('active');
+ $signInView.removeClass('active');
+ $signUpTab.addClass('active');
+ $signUpView.addClass('active');
+ return false;
+ });
+
+ $signinTab.on('click', () => {
+ $signUpTab.removeClass('active');
+ $signUpView.removeClass('active');
+ $signinTab.addClass('active');
+ $signInView.addClass('active');
+ });
+}
+
$(document).ready(async () => {
// Show exact time
$('.time-since').each(function () {
@@ -2456,6 +2483,9 @@ $(document).ready(async () => {
window.location = $(this).data('href');
});
+ // link-account tab handle
+ initLinkAccountView();
+
// Dropzone
const $dropzone = $('#dropzone');
if ($dropzone.length > 0) {