gitlabhq/app/assets/javascripts/projects.js.coffee

21 lines
655 B
CoffeeScript
Raw Normal View History

window.Projects = ->
2012-09-06 14:44:44 +02:00
$('#project_name').on 'change', ->
slug = slugify $(@).val()
2012-09-06 16:56:33 +02:00
$('#project_code, #project_path').val slug
2012-09-06 14:44:44 +02:00
$('.new_project, .edit_project').on 'ajax:before', ->
$('.project_new_holder, .project_edit_holder').hide()
$('.save-project-loader').show()
2012-09-06 14:44:44 +02:00
$('form #project_default_branch').chosen()
disableButtonIfEmtpyField '#project_name', '.project-submit'
# Git clone panel switcher
$ ->
2012-09-06 14:44:44 +02:00
scope = $ '.project_clone_holder'
if scope.length > 0
$('a, button', scope).click ->
2012-09-06 14:44:44 +02:00
$('a, button', scope).removeClass 'active'
$(@).addClass 'active'
$('#project_clone', scope).val $(@).data 'clone'