Commit 637e64c2 authored by Robert Speicher's avatar Robert Speicher

Clean up the Git protocol switcher JS

Also re-adds the `.clone` updating that was removed accidentally.
Thanks, tests!
parent 1d80cd31
class @Project class @Project
constructor: -> constructor: ->
# Git clone panel switcher # Git protocol switcher
cloneHolder = $('.git-clone-holder') $('.js-protocol-switch').click ->
if cloneHolder.length return if $(@).hasClass('active')
$('.js-protocol-switch', cloneHolder).click ->
$('.js-protocol-switch', cloneHolder).toggleClass('active') # Toggle 'active' for both buttons
$('#project_clone').val($(@).data('clone')) $('.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 # Ref switcher
$('.project-refs-select').on 'change', -> $('.project-refs-select').on 'change', ->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment