kristianmandrup / masonry-rails

JQuery Masonry plugin ready for use with Rails asset pipeline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Breaks when using Twitter Bootstrap

kristianmandrup opened this issue · comments

When using Twitter Bootstrap, the masonry and isotope calculations seem to break down for some reason. If anyone has a solution to this, please let me know!!! :)

Yeah, please tell me ;)

Removing "container-fluid" helps.

commented

Did you ever get masonry-rails to work with https://github.com/seyhunak/twitter-bootstrap-rails

Also, will you be supporting Bootstrap 3?

As I understand it, twitter bootstrap is mainly a CSS skin engine, using CSS classes. Any conflict is most likely due to clashes with reserved TS CSS ids or classes. Try to tweak the ones masonry uses by default and I think you should be able to avoid the conflicts.

nop its not working in that way either... :(

commented

@vjaykoogu Can you put a JSFiddle of what you see as a problem?

I can confirm that I've gotten this working with Bootstrap 3. Is anyone still having issues?

commented

@kevinholler Can you make a quick demo and link us to the repo? That would be really great!

I'm not maintaining this gem at the moment (too busy with Node etc). Please feel free to add examples/demos to an examples folder, update the README and patch with any fixes necessary ;) Thanks!

@kristianmandrup @akshatpradhan I'll look into this more over the weekend and will update 👍

commented

@kevinholler Actually, can you send a PR with a examples/ folder and update the README as well? That would be great and we can merge it in.

This issue can likely be closed. A friend of mine was able to use this gem with Bootstrap (Rails 5) without problems: https://github.com/choonggg/flickr-search

Thanks :)

What I should have said was that my friend used this gem in combination with Bootstrap without any complaints. Looking at the responsiveness of his demo app on heroku, however, I suspect that there are further issues.
image

So there may be an issue, but it doesn't seem to be Bootstrap specific.

My friend had col-md-4 as the only width constraint for his bricks and nothing setting his #masonry-container width, so for any window.width() < 992, his bricks did basically whatever they wanted to.

One possible issue: Instead of starting with a full-size browser and shrinking it, I tried refreshing with a thin browser (width < 992 pxs, so no set width for bricks or column), this resulting in all the bricks being positioned at 0,0, which made it look like there was only one brick there. Shrinking the browser when there is no set width for bricks or container also seems to mean that the number of columns do not change, even if this results in horizontal overflow.

Possible solution: If there is no set width for bricks or the container, the container could revert to a single column with display:block bricks.