0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-23 15:34:37 +01:00

fix link account ui (#14763)

Signed-off-by: a1012112796 <1012112796@qq.com>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
a1012112796 2021-02-22 09:14:27 +08:00 committed by GitHub
parent a50ca28355
commit 1ecdc55aff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 12 deletions

View file

@ -12,7 +12,7 @@
{{.i18n.Tr "auth.oauth_signin_tab"}}
</a>
</div>
</div>
<div class="ui middle very relaxed page grid">
<div class="column">
<div class="ui tab {{if not .user_exists}}active{{end}}"
@ -28,6 +28,5 @@
</div>
</div>
</div>
</div>
{{template "base/footer" .}}

View file

@ -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) {