{"action":"created","comment":{"url":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/comments/36023566","id":36023566,"diff_hunk":"@@ -140,9 +143,14 @@\n     // The 'scope' parameter is optional. If it's not passed in, '$rootScope' is used.\n     this.when = function(list, callback, scope) {\n       window.addEventListener('resize', function(event) {\n-        if (that.is(list) === true) {\n-          safeApply(callback(that.is(list)), scope);\n-        }\n+\n+        // iOS fix: Has the window size really changed? (iOS sends resize event on scroll too)\n+        if (window.innerWidth !== that.innerWidth) {\n+          if (that.is(list) === true) {\n+            safeApply(callback(that.is(list)), scope);","path":"match-media.js","position":30,"original_position":30,"commit_id":"03b9d67e7c1ef389e38bc69a7c5d9219b344a5ae","original_commit_id":"03b9d67e7c1ef389e38bc69a7c5d9219b344a5ae","user":{"login":"jacopotarantino","id":1176888,"avatar_url":"https://avatars.githubusercontent.com/u/1176888?v=3","gravatar_id":"","url":"https://api.github.com/users/jacopotarantino","html_url":"https://github.com/jacopotarantino","followers_url":"https://api.github.com/users/jacopotarantino/followers","following_url":"https://api.github.com/users/jacopotarantino/following{/other_user}","gists_url":"https://api.github.com/users/jacopotarantino/gists{/gist_id}","starred_url":"https://api.github.com/users/jacopotarantino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacopotarantino/subscriptions","organizations_url":"https://api.github.com/users/jacopotarantino/orgs","repos_url":"https://api.github.com/users/jacopotarantino/repos","events_url":"https://api.github.com/users/jacopotarantino/events{/privacy}","received_events_url":"https://api.github.com/users/jacopotarantino/received_events","type":"User","site_admin":false},"body":"Shouldn't you also re-set `that.innerWidth` here? As I read it, if somebody changes the window size back to the original, the callback won't get called..","created_at":"2015-07-31T22:48:59Z","updated_at":"2015-07-31T22:48:59Z","html_url":"https://github.com/jacopotarantino/angular-match-media/pull/16#discussion_r36023566","pull_request_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/comments/36023566"},"html":{"href":"https://github.com/jacopotarantino/angular-match-media/pull/16#discussion_r36023566"},"pull_request":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/16","id":41327093,"html_url":"https://github.com/jacopotarantino/angular-match-media/pull/16","diff_url":"https://github.com/jacopotarantino/angular-match-media/pull/16.diff","patch_url":"https://github.com/jacopotarantino/angular-match-media/pull/16.patch","issue_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/issues/16","number":16,"state":"open","locked":false,"title":"Fix for .when method","user":{"login":"bitflower","id":6666636,"avatar_url":"https://avatars.githubusercontent.com/u/6666636?v=3","gravatar_id":"","url":"https://api.github.com/users/bitflower","html_url":"https://github.com/bitflower","followers_url":"https://api.github.com/users/bitflower/followers","following_url":"https://api.github.com/users/bitflower/following{/other_user}","gists_url":"https://api.github.com/users/bitflower/gists{/gist_id}","starred_url":"https://api.github.com/users/bitflower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitflower/subscriptions","organizations_url":"https://api.github.com/users/bitflower/orgs","repos_url":"https://api.github.com/users/bitflower/repos","events_url":"https://api.github.com/users/bitflower/events{/privacy}","received_events_url":"https://api.github.com/users/bitflower/received_events","type":"User","site_admin":false},"body":"Hey J!\r\n\r\nAnother small fix regarding iOS behaviour and the .when method. The .when function really only makes sense on iOS with this fix. I had a case where I was infinitely scrolling and due to the fact that iOS is throwing resize events on scroll ocassionally made the .when function useless. So I added this.\r\n\r\nCheck it.\r\n\r\nMatt","created_at":"2015-07-31T10:35:28Z","updated_at":"2015-07-31T22:48:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8cd728801a08aa4f24854a4c9932d5d339715a12","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/16/commits","review_comments_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/16/comments","review_comment_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/issues/16/comments","statuses_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/statuses/03b9d67e7c1ef389e38bc69a7c5d9219b344a5ae","head":{"label":"bitflower:master","ref":"master","sha":"03b9d67e7c1ef389e38bc69a7c5d9219b344a5ae","user":{"login":"bitflower","id":6666636,"avatar_url":"https://avatars.githubusercontent.com/u/6666636?v=3","gravatar_id":"","url":"https://api.github.com/users/bitflower","html_url":"https://github.com/bitflower","followers_url":"https://api.github.com/users/bitflower/followers","following_url":"https://api.github.com/users/bitflower/following{/other_user}","gists_url":"https://api.github.com/users/bitflower/gists{/gist_id}","starred_url":"https://api.github.com/users/bitflower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitflower/subscriptions","organizations_url":"https://api.github.com/users/bitflower/orgs","repos_url":"https://api.github.com/users/bitflower/repos","events_url":"https://api.github.com/users/bitflower/events{/privacy}","received_events_url":"https://api.github.com/users/bitflower/received_events","type":"User","site_admin":false},"repo":{"id":27481618,"name":"angular-match-media","full_name":"bitflower/angular-match-media","owner":{"login":"bitflower","id":6666636,"avatar_url":"https://avatars.githubusercontent.com/u/6666636?v=3","gravatar_id":"","url":"https://api.github.com/users/bitflower","html_url":"https://github.com/bitflower","followers_url":"https://api.github.com/users/bitflower/followers","following_url":"https://api.github.com/users/bitflower/following{/other_user}","gists_url":"https://api.github.com/users/bitflower/gists{/gist_id}","starred_url":"https://api.github.com/users/bitflower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitflower/subscriptions","organizations_url":"https://api.github.com/users/bitflower/orgs","repos_url":"https://api.github.com/users/bitflower/repos","events_url":"https://api.github.com/users/bitflower/events{/privacy}","received_events_url":"https://api.github.com/users/bitflower/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bitflower/angular-match-media","description":"Angular module to use Bootstrap3 media queries in your angular controllers.","fork":true,"url":"https://api.github.com/repos/bitflower/angular-match-media","forks_url":"https://api.github.com/repos/bitflower/angular-match-media/forks","keys_url":"https://api.github.com/repos/bitflower/angular-match-media/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitflower/angular-match-media/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitflower/angular-match-media/teams","hooks_url":"https://api.github.com/repos/bitflower/angular-match-media/hooks","issue_events_url":"https://api.github.com/repos/bitflower/angular-match-media/issues/events{/number}","events_url":"https://api.github.com/repos/bitflower/angular-match-media/events","assignees_url":"https://api.github.com/repos/bitflower/angular-match-media/assignees{/user}","branches_url":"https://api.github.com/repos/bitflower/angular-match-media/branches{/branch}","tags_url":"https://api.github.com/repos/bitflower/angular-match-media/tags","blobs_url":"https://api.github.com/repos/bitflower/angular-match-media/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitflower/angular-match-media/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitflower/angular-match-media/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitflower/angular-match-media/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitflower/angular-match-media/statuses/{sha}","languages_url":"https://api.github.com/repos/bitflower/angular-match-media/languages","stargazers_url":"https://api.github.com/repos/bitflower/angular-match-media/stargazers","contributors_url":"https://api.github.com/repos/bitflower/angular-match-media/contributors","subscribers_url":"https://api.github.com/repos/bitflower/angular-match-media/subscribers","subscription_url":"https://api.github.com/repos/bitflower/angular-match-media/subscription","commits_url":"https://api.github.com/repos/bitflower/angular-match-media/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitflower/angular-match-media/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitflower/angular-match-media/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitflower/angular-match-media/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitflower/angular-match-media/contents/{+path}","compare_url":"https://api.github.com/repos/bitflower/angular-match-media/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitflower/angular-match-media/merges","archive_url":"https://api.github.com/repos/bitflower/angular-match-media/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitflower/angular-match-media/downloads","issues_url":"https://api.github.com/repos/bitflower/angular-match-media/issues{/number}","pulls_url":"https://api.github.com/repos/bitflower/angular-match-media/pulls{/number}","milestones_url":"https://api.github.com/repos/bitflower/angular-match-media/milestones{/number}","notifications_url":"https://api.github.com/repos/bitflower/angular-match-media/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitflower/angular-match-media/labels{/name}","releases_url":"https://api.github.com/repos/bitflower/angular-match-media/releases{/id}","created_at":"2014-12-03T10:25:12Z","updated_at":"2015-01-22T16:08:55Z","pushed_at":"2015-07-31T10:33:09Z","git_url":"git://github.com/bitflower/angular-match-media.git","ssh_url":"git@github.com:bitflower/angular-match-media.git","clone_url":"https://github.com/bitflower/angular-match-media.git","svn_url":"https://github.com/bitflower/angular-match-media","homepage":"https://jack.ofspades.com/angular-matchmedia-module/","size":160,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jacopotarantino:master","ref":"master","sha":"511a8f04ec44c86e8713939c0d5bdcbd21f25641","user":{"login":"jacopotarantino","id":1176888,"avatar_url":"https://avatars.githubusercontent.com/u/1176888?v=3","gravatar_id":"","url":"https://api.github.com/users/jacopotarantino","html_url":"https://github.com/jacopotarantino","followers_url":"https://api.github.com/users/jacopotarantino/followers","following_url":"https://api.github.com/users/jacopotarantino/following{/other_user}","gists_url":"https://api.github.com/users/jacopotarantino/gists{/gist_id}","starred_url":"https://api.github.com/users/jacopotarantino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacopotarantino/subscriptions","organizations_url":"https://api.github.com/users/jacopotarantino/orgs","repos_url":"https://api.github.com/users/jacopotarantino/repos","events_url":"https://api.github.com/users/jacopotarantino/events{/privacy}","received_events_url":"https://api.github.com/users/jacopotarantino/received_events","type":"User","site_admin":false},"repo":{"id":15515615,"name":"angular-match-media","full_name":"jacopotarantino/angular-match-media","owner":{"login":"jacopotarantino","id":1176888,"avatar_url":"https://avatars.githubusercontent.com/u/1176888?v=3","gravatar_id":"","url":"https://api.github.com/users/jacopotarantino","html_url":"https://github.com/jacopotarantino","followers_url":"https://api.github.com/users/jacopotarantino/followers","following_url":"https://api.github.com/users/jacopotarantino/following{/other_user}","gists_url":"https://api.github.com/users/jacopotarantino/gists{/gist_id}","starred_url":"https://api.github.com/users/jacopotarantino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacopotarantino/subscriptions","organizations_url":"https://api.github.com/users/jacopotarantino/orgs","repos_url":"https://api.github.com/users/jacopotarantino/repos","events_url":"https://api.github.com/users/jacopotarantino/events{/privacy}","received_events_url":"https://api.github.com/users/jacopotarantino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacopotarantino/angular-match-media","description":"Angular module to use Bootstrap3 media queries in your angular controllers.","fork":false,"url":"https://api.github.com/repos/jacopotarantino/angular-match-media","forks_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/forks","keys_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/teams","hooks_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/hooks","issue_events_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/issues/events{/number}","events_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/events","assignees_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/assignees{/user}","branches_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/branches{/branch}","tags_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/tags","blobs_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/statuses/{sha}","languages_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/languages","stargazers_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/stargazers","contributors_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/contributors","subscribers_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/subscribers","subscription_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/subscription","commits_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/contents/{+path}","compare_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/merges","archive_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/downloads","issues_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/issues{/number}","pulls_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls{/number}","milestones_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/milestones{/number}","notifications_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/labels{/name}","releases_url":"https://api.github.com/repos/jacopotarantino/angular-match-media/releases{/id}","created_at":"2013-12-29T21:55:26Z","updated_at":"2015-07-24T12:47:12Z","pushed_at":"2015-07-31T10:35:30Z","git_url":"git://github.com/jacopotarantino/angular-match-media.git","ssh_url":"git@github.com:jacopotarantino/angular-match-media.git","clone_url":"https://github.com/jacopotarantino/angular-match-media.git","svn_url":"https://github.com/jacopotarantino/angular-match-media","homepage":"https://jack.ofspades.com/angular-matchmedia-module/","size":308,"stargazers_count":45,"watchers_count":45,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":2,"forks":12,"open_issues":2,"watchers":45,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/16"},"html":{"href":"https://github.com/jacopotarantino/angular-match-media/pull/16"},"issue":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/issues/16"},"comments":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/jacopotarantino/angular-match-media/statuses/03b9d67e7c1ef389e38bc69a7c5d9219b344a5ae"}}}}