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
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', ->
......
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