debian-mirror-gitlab/app/assets/javascripts/project.js.coffee

27 lines
904 B
CoffeeScript
Raw Normal View History

2015-04-26 12:48:37 +05:30
class @Project
2014-09-02 18:07:02 +05:30
constructor: ->
2015-04-26 12:48:37 +05:30
# Git clone panel switcher
2015-09-11 14:41:01 +05:30
cloneHolder = $('.git-clone-holder')
if cloneHolder.length
$('a, button', cloneHolder).click ->
$('a, button', cloneHolder).removeClass 'active'
2015-04-26 12:48:37 +05:30
$(@).addClass 'active'
2015-09-11 14:41:01 +05:30
$('#project_clone', cloneHolder).val $(@).data 'clone'
2015-04-26 12:48:37 +05:30
$(".clone").text("").append $(@).data 'clone'
# Ref switcher
$('.project-refs-select').on 'change', ->
$(@).parents('form').submit()
$('.hide-no-ssh-message').on 'click', (e) ->
path = '/'
$.cookie('hide_no_ssh_message', 'false', { path: path })
$(@).parents('.no-ssh-key-message').remove()
e.preventDefault()
$('.hide-no-password-message').on 'click', (e) ->
path = '/'
$.cookie('hide_no_password_message', 'false', { path: path })
$(@).parents('.no-password-message').remove()
e.preventDefault()