ajax-loader for dashboard
This commit is contained in:
parent
8426846d6d
commit
3dc94ba8eb
4 changed files with 27 additions and 2 deletions
BIN
app/assets/images/ajax-loader-facebook.gif
Normal file
BIN
app/assets/images/ajax-loader-facebook.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 723 B |
11
app/assets/javascripts/loader.js
Normal file
11
app/assets/javascripts/loader.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
var Loader = {
|
||||
img_src: "/assets/ajax-loader.gif",
|
||||
|
||||
html:
|
||||
function(width) {
|
||||
img = $("<img>");
|
||||
img.attr("width", width);
|
||||
img.attr("src", this.img_src);
|
||||
return img;
|
||||
}
|
||||
}
|
|
@ -581,3 +581,9 @@ h4.middle-panel {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-loader {
|
||||
float:right;
|
||||
margin-right:30px;
|
||||
display:none;
|
||||
}
|
||||
|
|
|
@ -2,12 +2,20 @@
|
|||
= 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"
|
||||
= link_to "Issues", dashboard_issues_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide"
|
||||
= 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"
|
||||
|
||||
%img{:src => "/assets/ajax-loader-facebook.gif", :class => "dashboard-loader"}
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
$(".dash-button").live("click", function() {
|
||||
$(".dash-button").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
})
|
||||
});
|
||||
|
||||
$(".dash-button").live("ajax:before", function() {
|
||||
$(".dashboard-loader").show();
|
||||
});
|
||||
|
||||
$(".dash-button").live("ajax:complete", function() {
|
||||
$(".dashboard-loader").hide();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue