Skip to content

Commit

Permalink
Merge pull request ares-ensiie#36 from barodeur/fix_gallery_loading
Browse files Browse the repository at this point in the history
use imageloaded to wait for images before masonry!
  • Loading branch information
barodeur committed Mar 8, 2013
2 parents eda0c7c + d376e23 commit cf66359
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr
//= require bootstrap/load-image.min
//= require bootstrap/image-gallery.min
//= require jquery.imageloaded
//= require masonry
//= require select2
//= require_tree .
Expand Down
5 changes: 3 additions & 2 deletions app/views/gallery/gallery/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
= a.date.strftime("%F")

:coffeescript
$(window).load ->
$('.albums').masonry
$container = $('.albums')
$container.imagesLoaded ->
$container.masonry
itemSelector: '.album'
columnWidth: (containerWidth) ->
containerWidth / 4
3 changes: 3 additions & 0 deletions vendor/assets/javascripts/jquery.imageloaded.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cf66359

Please sign in to comment.