Commit 3dc94ba8eb74caa6f4eae29970fe261f51e1942e
1 parent
8426846d
Exists in
master
and in
4 other branches
ajax-loader for dashboard
Showing
4 changed files
with
27 additions
and
2 deletions
Show diff stats
723 Bytes
app/assets/stylesheets/projects.css.scss
app/views/dashboard/_menu.html.haml
@@ -2,12 +2,20 @@ | @@ -2,12 +2,20 @@ | ||
2 | = link_to "Activities", dashboard_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_path) || current_page?(root_path) }", :id => "activities_slide" | 2 | = link_to "Activities", dashboard_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_path) || current_page?(root_path) }", :id => "activities_slide" |
3 | = link_to "Issues", dashboard_issues_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide" | 3 | = link_to "Issues", dashboard_issues_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide" |
4 | = link_to "Merge Requests", dashboard_merge_requests_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" | 4 | = link_to "Merge Requests", dashboard_merge_requests_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" |
5 | - | 5 | + %img{:src => "/assets/ajax-loader-facebook.gif", :class => "dashboard-loader"} |
6 | 6 | ||
7 | :javascript | 7 | :javascript |
8 | $(function(){ | 8 | $(function(){ |
9 | $(".dash-button").live("click", function() { | 9 | $(".dash-button").live("click", function() { |
10 | $(".dash-button").removeClass("active"); | 10 | $(".dash-button").removeClass("active"); |
11 | $(this).addClass("active"); | 11 | $(this).addClass("active"); |
12 | - }) | 12 | + }); |
13 | + | ||
14 | + $(".dash-button").live("ajax:before", function() { | ||
15 | + $(".dashboard-loader").show(); | ||
16 | + }); | ||
17 | + | ||
18 | + $(".dash-button").live("ajax:complete", function() { | ||
19 | + $(".dashboard-loader").hide(); | ||
20 | + }); | ||
13 | }); | 21 | }); |