Update the projects js file to coffeescript; refactor the clone panel switcher
This commit is contained in:
parent
c1ff89fa2a
commit
7e76610d0a
4 changed files with 18 additions and 45 deletions
|
@ -1,25 +1,21 @@
|
|||
function Projects() {
|
||||
$("#project_name").live("change", function(){
|
||||
var slug = slugify($(this).val());
|
||||
$("#project_code").val(slug);
|
||||
$("#project_path").val(slug);
|
||||
});
|
||||
window.Projects = ->
|
||||
$("#project_name").live "change", ->
|
||||
slug = slugify($(this).val())
|
||||
$("#project_code").val(slug)
|
||||
$("#project_path").val(slug)
|
||||
|
||||
$('.new_project, .edit_project').live('ajax:before', function() {
|
||||
$('.project_new_holder, .project_edit_holder').hide();
|
||||
$('.save-project-loader').show();
|
||||
});
|
||||
$(".new_project, .edit_project").live "ajax:before", ->
|
||||
$(".project_new_holder, .project_edit_holder").hide()
|
||||
$(".save-project-loader").show()
|
||||
|
||||
$('form #project_default_branch').chosen();
|
||||
$("form #project_default_branch").chosen()
|
||||
disableButtonIfEmtpyField "#project_name", ".project-submit"
|
||||
|
||||
disableButtonIfEmtpyField("#project_name", ".project-submit")
|
||||
}
|
||||
|
||||
function initGitCloneSwitcher() {
|
||||
var link_sel = ".project_clone_holder button";
|
||||
$(link_sel).bind("click", function(e) {
|
||||
$(link_sel).removeClass("active");
|
||||
$(this).addClass("active");
|
||||
$("#project_clone").val($(this).attr("data-clone"));
|
||||
})
|
||||
}
|
||||
# Git clone panel switcher
|
||||
$ ->
|
||||
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'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue