Needs review
Project:
Isotope (with Masonry and Packery)
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Jul 2016 at 11:34 UTC
Updated:
13 Jul 2017 at 16:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mccrodp commentedComment #3
Chris Gillis commentedNice work on this Paul, thanks for keeping this rolling. I haven't been able to get this patch working unfortunately. Here are the steps I took.
- On a fresh install, generate a load of content and enable views_infinite_scroll (2.x).
- Create a simple view of content (50 items, paged at 10) and infinite scroll. Add some text to the view header.
- Infinite scroll works as expected.
- Make another view to act as the "filter". Simple html-list of taxonomy terms. Add this to the header of the content view.
- Content view now breaks. As I scroll down the page, I get the view header duplicated with each new block of content that is loaded. Also, each time the whole result is appended. So On the first scroll, twenty items (with header) are appended, on the next scroll thrity are appended, etc.
- Note that this breakage seems to just be an infinite-scroll bug. To this point I have not used isotope or patched anything.
- Now I apply the patches to both modules, change the view type to isotope grid, and the filter view to isotope filter.
- The result is now that when I scroll down, the window just jumps back to the top of the screen and nothing is appended. This is different functionality but still broken.
- No JS errors visible in console.
Hopefully that's enough info for you to debug further? Let me know if I've made a mistake.
Cheers,
Chris
Comment #4
mccrodp commentedThank for reviewing, Chris. I will take a look by following your steps above next week hopefully.
This came about as I wanted to implement an improved AJAX integration for isotope, to take advantage of isotope animation / transitions. I was using Views Infinite Scroll as research / proof of concept. I noticed that 2.x behaves differently in this regard: #2761547: Why does 1.x append rows and 2.x replace the whole view? The 1.x branch may be more along the lines of what I'm looking for. Please see #2762983: Improve and customise AJAX requests to merge view rows when you get a chance and if you have any suggestions, let me know.
Comment #5
mccrodp commentedTaking a look at this again now. I opened an issue on views infinite scroll: #2764125: Views header is duplicated after load more. It will cause issue with the filters in the view headers until that is solved, but perhaps isotope views without the isotope filters in view headers will be ok, such as AJAX views which use views provided filters.
Comment #6
mccrodp commentedI found an issue with the patch, the views infinite scroll pager actually replaced all element rather than appending. This was due to the selector.
I changed from :
$content_selector = '.view-content > .isotope-container';to
$content_selector = '.view-content .isotope-container';Now it should be working, even with the views infinite scroll bug as we override the selectors in isotope.
Comment #7
stephaniefuda commentedHello All,
I've just tested the patch in Comment #6 and here's what I see:
I'm using views infinite scroll 2.0 (stable) and Isotope 7.x-2.x-dev.
Thank you!
Comment #8
alibama commentedI'm seeing the same thing as Stephanie_42 with views infinite scroll 2.x-dev & isotope dev
Comment #9
rcodinaPatch on #6 works for me combined with patch #2 on #2761365: Allow modules to specify their own content selector. However, I also experience the problem of @Stephanie_42: newly added content is all left-aligned and in some cases there are overlappings. Any workaround for this?
Comment #10
rcodinaMy current workaround when you click on infinite pager and all elements are all left-aligned and overlapped:
I also have seen that in some cases, when you click the infinite pager, some elements are duplicated. But not always.
Comment #11
rcodinaI just found out that element duplication is not due to infinite scroll, it's just due to the fact I allow to assign multiple taxonomy values for each element.
Comment #12
rcodinaI found out how to fix my issues:
Comment #13
pribeh commentedHi rcodina, I tried the two patches (you reference in #9) as well and although the grid-items load without the container as hoped they all shift left. I tried the code you have above in #10 and it mostly works but every other load the grid-items appear to scatter (some show up in totally incorrect spots, sometimes overlapping with others). I'm thinking maybe it's a timing issue in regards to execution. Note, as soon as I resize the browser port they all reshuffle to their correct spots.
Here's the code I'm using:
Then I set the width to .isotope-element in CSS to 33%.
Comment #14
pribeh commentedUpon further investigation, I'm noticing the following behavior when the grid-items scatter:
- As soon as infinite scroll runs and loads the new grid-items they load in the correct positions.
- A split second later they scatter to random positions all across the browser port.
- If I inspect the markup of the grid items (li.isotope-element) that are out of place they appear to have a transform applied to them. If I remove the transform they go back to their correct position.
I'm not sure why the extra transform is being applied to the grid items (.isotope-element).