diff --git a/app/views/tree/_tree.html.haml b/app/views/tree/_tree.html.haml
index a98a44e90dd..cc45faa1459 100644
--- a/app/views/tree/_tree.html.haml
+++ b/app/views/tree/_tree.html.haml
@@ -46,6 +46,6 @@
:javascript
// Load last commit log for each file in tree
- $(window).load(function(){
+ $('#tree-slider').waitForImages(function() {
ajaxGet('#{@logs_path}');
});