diff options
Diffstat (limited to 'app/assets/javascripts/project.js.coffee')
-rw-r--r-- | app/assets/javascripts/project.js.coffee | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee index eb8c1fa1426..87c1b67a772 100644 --- a/app/assets/javascripts/project.js.coffee +++ b/app/assets/javascripts/project.js.coffee @@ -1,12 +1,12 @@ class @Project constructor: -> # Git clone panel switcher - scope = $ '.git-clone-holder' - if scope.length > 0 - $('a, button', scope).click -> - $('a, button', scope).removeClass 'active' + cloneHolder = $('.git-clone-holder') + if cloneHolder.length + $('a, button', cloneHolder).click -> + $('a, button', cloneHolder).removeClass 'active' $(@).addClass 'active' - $('#project_clone', scope).val $(@).data 'clone' + $('#project_clone', cloneHolder).val $(@).data 'clone' $(".clone").text("").append $(@).data 'clone' # Ref switcher @@ -24,3 +24,8 @@ class @Project $.cookie('hide_no_password_message', 'false', { path: path }) $(@).parents('.no-password-message').remove() e.preventDefault() + + $('.js-toggle-clone-holder').on 'click', (e) -> + cloneHolder.toggle() + + cloneHolder.hide() unless $('.empty-project').length |