{"action":"opened","issue":{"url":"https://api.github.com/repos/metafizzy/isotope/issues/1018","labels_url":"https://api.github.com/repos/metafizzy/isotope/issues/1018/labels{/name}","comments_url":"https://api.github.com/repos/metafizzy/isotope/issues/1018/comments","events_url":"https://api.github.com/repos/metafizzy/isotope/issues/1018/events","html_url":"https://github.com/metafizzy/isotope/issues/1018","id":123708757,"number":1018,"title":"Isotope cannot call methods on isotope prior to initialization; attempted to call 'insert' another one","user":{"login":"helenemartin","id":2430154,"avatar_url":"https://avatars.githubusercontent.com/u/2430154?v=3","gravatar_id":"","url":"https://api.github.com/users/helenemartin","html_url":"https://github.com/helenemartin","followers_url":"https://api.github.com/users/helenemartin/followers","following_url":"https://api.github.com/users/helenemartin/following{/other_user}","gists_url":"https://api.github.com/users/helenemartin/gists{/gist_id}","starred_url":"https://api.github.com/users/helenemartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helenemartin/subscriptions","organizations_url":"https://api.github.com/users/helenemartin/orgs","repos_url":"https://api.github.com/users/helenemartin/repos","events_url":"https://api.github.com/users/helenemartin/events{/privacy}","received_events_url":"https://api.github.com/users/helenemartin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-23T19:03:18Z","updated_at":"2015-12-23T19:03:18Z","closed_at":null,"body":"Hello  Alessandro\r\nI have been struggling with Infinite scrolling for ages.\r\n\r\nI am using Isotope infinite scrolling with filtering (using 'insert method') on Rails very confusing.\r\nI have pushed it on Heroku but pagination doesn't work.\r\nI have console error \"cannot call methods on isotope prior to initialization; attempted to call 'insert'\"\r\npins.js.coffee:\r\n$ ->\r\n  $(document).ready ->  \r\n    $('.pagination').hide() \r\n    $('#pins').imagesLoaded().always ->\r\n      $('#pins').isotope(\r\n        itemSelector: '.box'\r\n        isFitWidth: true)\r\n\r\n    $(\".button\").on(\"click\", ->\r\n      if $(this).attr('data-filter') == \"\"\r\n        $(\"#pins\").isotope(filter:'*');\r\n      else\r\n        $('#pins').isotope(filter:\"[data-filter*=\\\"\"+$(this).attr('data-filter')+\"\\\"]\")\r\n    )\r\n\r\n    if $('#pins').size() > 0\r\n      $(window).on 'scroll', ->\r\n        more_pins_url = $('.pagination .next a').attr('href')\r\n        if more_pins_url != undefined && $(window).scrollTop() > $(document).height() - $(window).height() - 60\r\n          $('.pagination').text(\"Fetching more pins...\")\r\n          $('.pagination').show()\r\n          console.log(more_pins_url)\r\n          $.getScript(more_pins_url)\r\n        return\r\n      return\r\n\r\nIndex.js.erb\r\nvar newItems = $('<%= j render(@pins) %>');\r\nconsole.log(1, newItems);\r\n// Append newItems to the pins container and tell isotope that there is new items to style\r\n$('#pins').isotope('insert', newItems);\r\n\r\n// Check if there is another page worth of pins, \r\n// If there is, change the pagination to the new will_paginate result\r\n<% if @pins.next_page %>\r\n  $('.pagination').replaceWith('<%= will_paginate(@pins) %>');\r\n\r\n// Otherwise, hide the pagination\r\n<% else %>\r\n  $('.pagination').remove();\r\n<% end %>\r\n\r\nThat would be great if you could have a look please\r\nThank you in advance\r\nWith kind regards\r\nMerry Xmas!\r\n\r\n\r\n\r\n    "}}