mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	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
This commit is contained in:
		@@ -1109,8 +1109,10 @@ async function initRepository() {
 | 
				
			|||||||
    $('.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');
 | 
					    if ($('#repo-clone-ssh').length > 0) {
 | 
				
			||||||
    localStorage.setItem('repo-clone-protocol', 'https');
 | 
					      $('#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();
 | 
				
			||||||
@@ -2436,7 +2438,9 @@ $(document).ready(async () => {
 | 
				
			|||||||
  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;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user