ソースを参照

Make localstorage read ssh or https correctly (#11483)

* Make localstorage read ssh or https correctly

* Update index.js

If not login there is only a "https" button, This commit fix  the "https" button hasn't blue border.

* Keep user selected whether or not to log in

* Update index.js
tags/v1.13.0-rc1
L0veSunshine 4年前
コミット
eb8abffcc1
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更7行の追加3行の削除
  1. 7
    3
      web_src/js/index.js

+ 7
- 3
web_src/js/index.js ファイルの表示

$('.clone-url').text($(this).data('link')); $('.clone-url').text($(this).data('link'));
$('#repo-clone-url').val($(this).data('link')); $('#repo-clone-url').val($(this).data('link'));
$(this).addClass('blue'); $(this).addClass('blue');
$('#repo-clone-ssh').removeClass('blue');
localStorage.setItem('repo-clone-protocol', 'https');
if ($('#repo-clone-ssh').length > 0) {
$('#repo-clone-ssh').removeClass('blue');
localStorage.setItem('repo-clone-protocol', 'https');
}
}); });
$('#repo-clone-url').on('click', function () { $('#repo-clone-url').on('click', function () {
$(this).select(); $(this).select();
if ($('#repo-clone-url').length > 0) { if ($('#repo-clone-url').length > 0) {
switch (localStorage.getItem('repo-clone-protocol')) { switch (localStorage.getItem('repo-clone-protocol')) {
case 'ssh': case 'ssh':
if ($('#repo-clone-ssh').length === 0) {
if ($('#repo-clone-ssh').length > 0) {
$('#repo-clone-ssh').trigger('click');
} else {
$('#repo-clone-https').trigger('click'); $('#repo-clone-https').trigger('click');
} }
break; break;

読み込み中…
キャンセル
保存