Skip to content
Snippets Groups Projects
Commit 637e64c2 authored by Robert Speicher's avatar Robert Speicher
Browse files

Clean up the Git protocol switcher JS

Also re-adds the `.clone` updating that was removed accidentally.
Thanks, tests!
parent 1d80cd31
No related branches found
No related tags found
1 merge request!1896Add clipboard button for project clone panel
Pipeline #
class @Project
constructor: ->
# Git clone panel switcher
cloneHolder = $('.git-clone-holder')
if cloneHolder.length
$('.js-protocol-switch', cloneHolder).click ->
$('.js-protocol-switch', cloneHolder).toggleClass('active')
$('#project_clone').val($(@).data('clone'))
# Git protocol switcher
$('.js-protocol-switch').click ->
return if $(@).hasClass('active')
# Toggle 'active' for both buttons
$('.js-protocol-switch').toggleClass('active')
url = $(@).data('clone')
# Update the input field
$('#project_clone').val(url)
# Update the command line instructions
$('.clone').text(url)
 
# Ref switcher
$('.project-refs-select').on 'change', ->
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment