diff options
author | Ciro Santilli <ciro.santilli@gmail.com> | 2014-07-14 11:50:35 +0200 |
---|---|---|
committer | Ciro Santilli <ciro.santilli@gmail.com> | 2014-07-17 22:47:16 +0200 |
commit | ecd771ccdfe54b08ea7f80f64667228b7938238d (patch) | |
tree | b55cd6b64c679776c00c9e8f4560fa60c711eada | |
parent | c589029667644df4593572e2c94226bd2a5f7740 (diff) | |
download | gitlab-ce-ecd771ccdfe54b08ea7f80f64667228b7938238d.tar.gz |
Move coffee to assets/project
-rw-r--r-- | app/assets/javascripts/project.js.coffee | 5 | ||||
-rw-r--r-- | app/views/projects/_home_panel.html.haml | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee index 4262418fd5e..d81cc087df9 100644 --- a/app/assets/javascripts/project.js.coffee +++ b/app/assets/javascripts/project.js.coffee @@ -46,3 +46,8 @@ $ -> $.cookie('hide_no_ssh_message', 'false', { path: path }) $(@).parents('.no-ssh-key-message').hide() e.preventDefault() + + $('.project-home-panel .star').on 'ajax:success', (e, data, status, xhr) -> + $(@).toggleClass('on').find('.count').html(data.star_count) + .on 'ajax:error', (e, xhr, status, error) -> + new Flash('Star toggle failed. Try again later.', 'alert') diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 6d7f859c22a..48f5a90cf23 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -44,11 +44,6 @@ title: 'Unstar this project.', starred: true, signed_in: true - :coffeescript - $('.star').on 'ajax:success', (e, data, status, xhr) -> - $(@).toggleClass('on').find('.count').html(data.star_count) - .on 'ajax:error', (e, xhr, status, error) -> - new Flash('Star toggle failed. Try again later.', 'alert') - else = render 'link_to_toggle_star', title: 'You must sign in to star a project.', |