diff options
author | Jason Lee <huacnlee@gmail.com> | 2015-11-10 19:17:37 +0800 |
---|---|---|
committer | Jason Lee <huacnlee@gmail.com> | 2015-11-10 19:17:37 +0800 |
commit | 18cb430f7983ea557cf2308f5ea7c0af8b79a7b5 (patch) | |
tree | 14580177aaed975bf2dd6ffa1c4aa2b327b021cc /app/views/projects/buttons | |
parent | 354b69dde2ba399a4269a0f544fd7a4e399d8b7e (diff) | |
download | gitlab-ce-18cb430f7983ea557cf2308f5ea7c0af8b79a7b5.tar.gz |
Replace CoffeeScript block into JavaScript in Views.
For example view: shared/issuable/_context
CoffeeScript: 190ms
JavaScript: 19.7ms
Diffstat (limited to 'app/views/projects/buttons')
-rw-r--r-- | app/views/projects/buttons/_star.html.haml | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/views/projects/buttons/_star.html.haml b/app/views/projects/buttons/_star.html.haml index 3501dddefbe..06583902035 100644 --- a/app/views/projects/buttons/_star.html.haml +++ b/app/views/projects/buttons/_star.html.haml @@ -4,11 +4,13 @@ %span.count = @project.star_count - :coffeescript - $('.project-home-panel .toggle-star').on 'ajax:success', (e, data, status, xhr) -> - $(@).replaceWith(data.html) - .on 'ajax:error', (e, xhr, status, error) -> - new Flash('Star toggle failed. Try again later.', 'alert') + :javascript + $('.project-home-panel .toggle-star').on('ajax:success', function (e, data, status, xhr) { + $(this).replaceWith(data.html); + }) + .on('ajax:error', function (e, xhr, status, error) { + new Flash('Star toggle failed. Try again later.', 'alert'); + }); - else = link_to new_user_session_path, class: 'btn has_tooltip star-btn', title: 'You must sign in to star a project' do |