Commit afb8b2c8

mo k <mo@mokhan.ca>
2012-09-20 12:54:10
run jquery masonry script after images are loaded and remove the read button from the index page.
1 parent 543ab21
Changed files (1)
app
views
app/views/tutorials/index.html.erb
@@ -1,7 +1,12 @@
 <% provide(:description, "The latest tutorials") -%>
 <% content_for :javascript do -%>
 <script type="text/javascript">  
-  $(function(){ $('.row').masonry({ itemSelector : '.span4' }); });
+  $(function(){
+    var container = $('.row');
+    container.imagesLoaded(function(){
+      container.masonry({ itemSelector : '.span4' }); 
+    });
+  });
 </script>
 <% end -%>
 <div class="row">
@@ -24,7 +29,7 @@
             <% end -%>
             </p>
             <p><%= tutorial.description %></p>
-            <p><a class="btn btn-primary" href="<%= tutorial.url %>">Read</a> <a class="btn" href="<%= url_for tutorial %>">View</a></p>
+            <p><a class="btn" href="<%= url_for tutorial %>">View</a></p>
           </div>
         </div>
       </div>