Commit 88d394d396f09fe018317443105cd08bd69e1d3f
1 parent
e7c2ee57
Exists in
master
and in
4 other branches
cleanup projects.coffee
Showing
1 changed file
with
12 additions
and
13 deletions
Show diff stats
app/assets/javascripts/projects.js.coffee
1 | window.Projects = -> | 1 | window.Projects = -> |
2 | - $("#project_name").live "change", -> | ||
3 | - slug = slugify($(this).val()) | ||
4 | - $("#project_code").val(slug) | ||
5 | - $("#project_path").val(slug) | 2 | + $('#project_name').on 'change', -> |
3 | + slug = slugify $(@).val() | ||
4 | + $('#project_code').val slug | ||
6 | 5 | ||
7 | - $(".new_project, .edit_project").live "ajax:before", -> | ||
8 | - $(".project_new_holder, .project_edit_holder").hide() | ||
9 | - $(".save-project-loader").show() | 6 | + $('.new_project, .edit_project').on 'ajax:before', -> |
7 | + $('.project_new_holder, .project_edit_holder').hide() | ||
8 | + $('.save-project-loader').show() | ||
10 | 9 | ||
11 | - $("form #project_default_branch").chosen() | ||
12 | - disableButtonIfEmtpyField "#project_name", ".project-submit" | 10 | + $('form #project_default_branch').chosen() |
11 | + disableButtonIfEmtpyField '#project_name', '.project-submit' | ||
13 | 12 | ||
14 | # Git clone panel switcher | 13 | # Git clone panel switcher |
15 | $ -> | 14 | $ -> |
16 | - scope = $('.project_clone_holder') | 15 | + scope = $ '.project_clone_holder' |
17 | if scope.length > 0 | 16 | if scope.length > 0 |
18 | $('a, button', scope).click -> | 17 | $('a, button', scope).click -> |
19 | - $('a, button', scope).removeClass('active') | ||
20 | - $(this).addClass('active') | ||
21 | - $('#project_clone', scope).val($(this).data('clone')) | 18 | + $('a, button', scope).removeClass 'active' |
19 | + $(@).addClass 'active' | ||
20 | + $('#project_clone', scope).val $(@).data 'clone' |