{"action":"created","issue":{"url":"https://api.github.com/repos/cargomedia/cm/issues/2410","repository_url":"https://api.github.com/repos/cargomedia/cm","labels_url":"https://api.github.com/repos/cargomedia/cm/issues/2410/labels{/name}","comments_url":"https://api.github.com/repos/cargomedia/cm/issues/2410/comments","events_url":"https://api.github.com/repos/cargomedia/cm/issues/2410/events","html_url":"https://github.com/cargomedia/cm/issues/2410","id":188237239,"number":2410,"title":"Fix lazyload memory leak","user":{"login":"vogdb","id":372386,"avatar_url":"https://avatars.githubusercontent.com/u/372386?v=3","gravatar_id":"","url":"https://api.github.com/users/vogdb","html_url":"https://github.com/vogdb","followers_url":"https://api.github.com/users/vogdb/followers","following_url":"https://api.github.com/users/vogdb/following{/other_user}","gists_url":"https://api.github.com/users/vogdb/gists{/gist_id}","starred_url":"https://api.github.com/users/vogdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vogdb/subscriptions","organizations_url":"https://api.github.com/users/vogdb/orgs","repos_url":"https://api.github.com/users/vogdb/repos","events_url":"https://api.github.com/users/vogdb/events{/privacy}","received_events_url":"https://api.github.com/users/vogdb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"vogdb","id":372386,"avatar_url":"https://avatars.githubusercontent.com/u/372386?v=3","gravatar_id":"","url":"https://api.github.com/users/vogdb","html_url":"https://github.com/vogdb","followers_url":"https://api.github.com/users/vogdb/followers","following_url":"https://api.github.com/users/vogdb/following{/other_user}","gists_url":"https://api.github.com/users/vogdb/gists{/gist_id}","starred_url":"https://api.github.com/users/vogdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vogdb/subscriptions","organizations_url":"https://api.github.com/users/vogdb/orgs","repos_url":"https://api.github.com/users/vogdb/repos","events_url":"https://api.github.com/users/vogdb/events{/privacy}","received_events_url":"https://api.github.com/users/vogdb/received_events","type":"User","site_admin":false},"assignees":[{"login":"vogdb","id":372386,"avatar_url":"https://avatars.githubusercontent.com/u/372386?v=3","gravatar_id":"","url":"https://api.github.com/users/vogdb","html_url":"https://github.com/vogdb","followers_url":"https://api.github.com/users/vogdb/followers","following_url":"https://api.github.com/users/vogdb/following{/other_user}","gists_url":"https://api.github.com/users/vogdb/gists{/gist_id}","starred_url":"https://api.github.com/users/vogdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vogdb/subscriptions","organizations_url":"https://api.github.com/users/vogdb/orgs","repos_url":"https://api.github.com/users/vogdb/repos","events_url":"https://api.github.com/users/vogdb/events{/privacy}","received_events_url":"https://api.github.com/users/vogdb/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-11-09T12:35:16Z","updated_at":"2016-11-09T15:17:48Z","closed_at":null,"body":"Currently lazyload leaks a lot with ajax-navigation. It has to be a well-known but still not fixed problem. tuupola/jquery_lazyload#269\r\nIn general we need to update the library to the latest master and custom-patch it for now to have `detroy` method.\r\ncc @zazabe @njam "},"comment":{"url":"https://api.github.com/repos/cargomedia/cm/issues/comments/259438692","html_url":"https://github.com/cargomedia/cm/issues/2410#issuecomment-259438692","issue_url":"https://api.github.com/repos/cargomedia/cm/issues/2410","id":259438692,"user":{"login":"vogdb","id":372386,"avatar_url":"https://avatars.githubusercontent.com/u/372386?v=3","gravatar_id":"","url":"https://api.github.com/users/vogdb","html_url":"https://github.com/vogdb","followers_url":"https://api.github.com/users/vogdb/followers","following_url":"https://api.github.com/users/vogdb/following{/other_user}","gists_url":"https://api.github.com/users/vogdb/gists{/gist_id}","starred_url":"https://api.github.com/users/vogdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vogdb/subscriptions","organizations_url":"https://api.github.com/users/vogdb/orgs","repos_url":"https://api.github.com/users/vogdb/repos","events_url":"https://api.github.com/users/vogdb/events{/privacy}","received_events_url":"https://api.github.com/users/vogdb/received_events","type":"User","site_admin":false},"created_at":"2016-11-09T15:17:48Z","updated_at":"2016-11-09T15:17:48Z","body":"`jquery.lazy` requires patch too :( As all other libraries. The thing is that we setup lazy loaders on elements by jQuery selector like this `$this.find('img.lazy').lazyload(options)`. In order to destroy this setup later we need to keep the link to the setup instance:\r\n```js\r\nvar instance = $this.find('img.lazy').lazyload(options)\r\n````\r\nNo plugin actually offers a mechanism to access instance by jQuery selector. Like this:\r\n```js\r\nvar instance = $this.find('img.lazy').data('lazyload');\r\ninstance.destroy();\r\n//or\r\n$this.find('img.lazy').lazyload('destroy');\r\n```\r\nWell, `jquery.lazy` offers but you need to hit exactly the same jQuery context with your selector. In other words `this.$('img.lazy')` and `this.$('.scrollable img.lazy')` will return different instance even pointing to the same elements. That forces us somehow to memorise links to instances which is an arguable solution cause complicates things a lot. I will research a bit more here."}}
{"actor":{"display_login":"vogdb"}}