Commit 88d394d3 authored by Nihad Abbasov's avatar Nihad Abbasov

cleanup projects.coffee

parent e7c2ee57
window.Projects = ->
$("#project_name").live "change", ->
slug = slugify($(this).val())
$("#project_code").val(slug)
$("#project_path").val(slug)
$('#project_name').on 'change', ->
slug = slugify $(@).val()
$('#project_code').val slug
$(".new_project, .edit_project").live "ajax:before", ->
$(".project_new_holder, .project_edit_holder").hide()
$(".save-project-loader").show()
$('.new_project, .edit_project').on 'ajax:before', ->
$('.project_new_holder, .project_edit_holder').hide()
$('.save-project-loader').show()
$("form #project_default_branch").chosen()
disableButtonIfEmtpyField "#project_name", ".project-submit"
$('form #project_default_branch').chosen()
disableButtonIfEmtpyField '#project_name', '.project-submit'
# Git clone panel switcher
$ ->
scope = $('.project_clone_holder')
scope = $ '.project_clone_holder'
if scope.length > 0
$('a, button', scope).click ->
$('a, button', scope).removeClass('active')
$(this).addClass('active')
$('#project_clone', scope).val($(this).data('clone'))
$('a, button', scope).removeClass 'active'
$(@).addClass 'active'
$('#project_clone', scope).val $(@).data 'clone'
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