Closed (won't fix)
Project:
Views Load More
Version:
7.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Feb 2014 at 13:17 UTC
Updated:
10 Feb 2016 at 23:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
guilopes commentedComment #2
almc commentedI've tested the current Masonry with Views Load More and this patch, and it works, thank you.
Comment #3
zmove commentedPatch works well.
Comment #4
adamgerthel commentedUhm, by looking a the code- it doesn't seem to handle any scenarios when Masonry isn't available. You've added:
wrapper.find('.view-content').masonry('reload');But calling masonry without actually having masonry will most likely cause a js error, no?
Comment #5
kenppx commentedWhen I apply this patch actually it works well when I use masonry.
But when masonry is not available we have a js error.
How can I solve this problem?
Comment #6
kenppx commentedI am not familiar with jquery and javascript.
But I wrote this and it works well.
Comment #7
kenppx commentedI have another problem.
Now I am using Views Load More+waypoint with Masonry API+masonry views.
My test web site is below.
http://153.121.53.235/postwall/
When I scroll down to the bottom of the page, sometimes infinite scroll does not work.
But then I scroll up the page, suddenly page loading starts.
My assumption is like this, Waypoint calculates the height of content before masonry
finish rendering of all blocks. So Waypoint can not detect the correct height.
If I can load waypoint after rendering of masonry block, problem may be solved.
But I do not have enough knowledge to solve this problem.
If you have any idea could you help me?
Thank you.
Comment #8
socialnicheguru commented#6 worked better. without the if statement, I get a masonry undefined error
Comment #9
m4oliveiHumm, the views_load_more.js file is not the place to make calls to masonry. Notice that at the end of
Drupal.ajax.prototype.commands.viewsLoadMoreAppend(), views_load_more module callsDrupal.attachBehaviors(wrapper, settings);. That will fire all the theattach()methods on all registeredDrupal.behaviorsobjects. That is where you should doing whatever is necessary to re-init masonry.See https://www.drupal.org/node/756722#behaviors. Also google "Drupal.behaviors" to find some info on the topic. Hope that helps.
As such, won't commit.
Comment #10
dmitrii commenteduse drupal_add_js() in theme/custom module to add following js code to fix masonry with the Views Load More module.
Comment #11
phm commented@dmitrii:
I tried this but settings.viewsLoadMore is undefined while the module is working fine otherwise. I can't figure out why.
Comment #12
tostinni commentedViews load more trigger
views_load_more.new_contentwhen new content is loaded so we can use this code in our theme :Just replace
VIEW_MACHINE_NAMEby your view machine name and it should work.Comment #13
guilopes commentedthe best way is #12 in my opinion
Comment #14
shabirahmad commentedHi Guys,
I am using masonry views module and creating a slideshow like the one on the link http://www.theclientsserver.com/clients/witte/
I have configured the module but the height of the view is not uniform (check the screenshot http://i.imgur.com/Tk5HSR3.png). How can I fix the view. also I am unable to apply vertical gutter as the margin is not working on absolutely positioned div.
Any idea will highly be appreciated
Thansk
Comment #15
marcelovaniHere is my solution:
Add a js file with the following:
This will make the command available to the ajax callback.
Now create a hook to alter the view and add the command to reload masonry
This will trigger the method reload, that will be passed to viewsMasonry.
You can use other methods if you want.
Also, as a selector I am automatically getting the id of the view.
Comment #16
socialnicheguru commentedin #15 in which js file do you put the code?
Comment #17
marcelovaniYou can save it with your modules and use drupal_add_js to include the it.
i.e.
One important thing that I forgot to mention, initially you will need to attach another behaviour to initialise the masonry
i.e.
This can be added on the same js example as above, right beneath "(function ($) {"
Comment #18
garethhallnz commentedNone of the above worked amazingly for me (Note I did not try #15)
I added the below to the theme's js file and seems to work.
Comment #19
bmpinto commentedMy way of solving this was to override jQuery's append function to trigger an event everytime something is appended to the container.
I'm using packery instead of masonry but it's not difficult to adapt.
Comment #20
johnny5th commentedGot this to work on mine with this