{"action":"closed","number":19,"pull_request":{"url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls/19","id":25364696,"html_url":"https://github.com/mathiasbynens/jquery-visibility/pull/19","diff_url":"https://github.com/mathiasbynens/jquery-visibility/pull/19.diff","patch_url":"https://github.com/mathiasbynens/jquery-visibility/pull/19.patch","issue_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/issues/19","number":19,"state":"closed","locked":false,"title":"Fixed namespace bug and added current state","user":{"login":"janpaepke","id":3076177,"avatar_url":"https://avatars.githubusercontent.com/u/3076177?v=3","gravatar_id":"","url":"https://api.github.com/users/janpaepke","html_url":"https://github.com/janpaepke","followers_url":"https://api.github.com/users/janpaepke/followers","following_url":"https://api.github.com/users/janpaepke/following{/other_user}","gists_url":"https://api.github.com/users/janpaepke/gists{/gist_id}","starred_url":"https://api.github.com/users/janpaepke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janpaepke/subscriptions","organizations_url":"https://api.github.com/users/janpaepke/orgs","repos_url":"https://api.github.com/users/janpaepke/repos","events_url":"https://api.github.com/users/janpaepke/events{/privacy}","received_events_url":"https://api.github.com/users/janpaepke/received_events","type":"User","site_admin":false},"body":"Hi Mathias,\r\n\r\nI changed the the namespace behavior because how you used it wasn't the intended way.\r\nLet me explain:\r\nYou added the namespace to the trigger which meant the callback would only be fired, when the user actually attached the listener `show.visibility`.\r\nUsing just `show`, like in your example, didn't work.\r\nUsing namespaces is something the user can decide when attaching listeners.\r\nThat is why I removed it from the trigger.\r\nNow it will work with both `show.visibility` and `show`. The difference is when the user decides to remove the listeners later he can do `off('.visibility')` and it will only be removed if he previously attached it using that namespace.\r\nIf users want to use namespaces they can and they will only try it when they are familiar with the jQuery logic of it.\r\nSo this is really completely user territory and expected jQuery behavior and that is also why I removed it from the README.\r\n\r\nThe second change I made concerns the variable `document.hidden`.\r\nIt is sometimes necessary to know the current state right from the page load.\r\nThe reason is that you can also reload a page while currently being in a different tab.\r\nSo whatever logic you have that depends on visibility will need to behave differently then right from the start.\r\n\r\nHave a look at the changes, but my guess is everything should be fine. :)\r\n\r\nbest regards,\r\nJ\r\n","created_at":"2014-12-02T18:50:25Z","updated_at":"2015-03-20T10:20:39Z","closed_at":"2015-03-20T10:20:39Z","merged_at":"2015-03-20T10:20:39Z","merge_commit_sha":"2aa3bb46885f4a1e258d8467e38eb489a92192d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls/19/commits","review_comments_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls/19/comments","review_comment_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/issues/19/comments","statuses_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/statuses/45efbfc550115d29c8d0aff95349e44aeabe6a96","head":{"label":"janpaepke:master","ref":"master","sha":"45efbfc550115d29c8d0aff95349e44aeabe6a96","user":{"login":"janpaepke","id":3076177,"avatar_url":"https://avatars.githubusercontent.com/u/3076177?v=3","gravatar_id":"","url":"https://api.github.com/users/janpaepke","html_url":"https://github.com/janpaepke","followers_url":"https://api.github.com/users/janpaepke/followers","following_url":"https://api.github.com/users/janpaepke/following{/other_user}","gists_url":"https://api.github.com/users/janpaepke/gists{/gist_id}","starred_url":"https://api.github.com/users/janpaepke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janpaepke/subscriptions","organizations_url":"https://api.github.com/users/janpaepke/orgs","repos_url":"https://api.github.com/users/janpaepke/repos","events_url":"https://api.github.com/users/janpaepke/events{/privacy}","received_events_url":"https://api.github.com/users/janpaepke/received_events","type":"User","site_admin":false},"repo":{"id":27445335,"name":"jquery-visibility","full_name":"janpaepke/jquery-visibility","owner":{"login":"janpaepke","id":3076177,"avatar_url":"https://avatars.githubusercontent.com/u/3076177?v=3","gravatar_id":"","url":"https://api.github.com/users/janpaepke","html_url":"https://github.com/janpaepke","followers_url":"https://api.github.com/users/janpaepke/followers","following_url":"https://api.github.com/users/janpaepke/following{/other_user}","gists_url":"https://api.github.com/users/janpaepke/gists{/gist_id}","starred_url":"https://api.github.com/users/janpaepke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janpaepke/subscriptions","organizations_url":"https://api.github.com/users/janpaepke/orgs","repos_url":"https://api.github.com/users/janpaepke/repos","events_url":"https://api.github.com/users/janpaepke/events{/privacy}","received_events_url":"https://api.github.com/users/janpaepke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/janpaepke/jquery-visibility","description":"Page Visibility shim for jQuery","fork":true,"url":"https://api.github.com/repos/janpaepke/jquery-visibility","forks_url":"https://api.github.com/repos/janpaepke/jquery-visibility/forks","keys_url":"https://api.github.com/repos/janpaepke/jquery-visibility/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janpaepke/jquery-visibility/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janpaepke/jquery-visibility/teams","hooks_url":"https://api.github.com/repos/janpaepke/jquery-visibility/hooks","issue_events_url":"https://api.github.com/repos/janpaepke/jquery-visibility/issues/events{/number}","events_url":"https://api.github.com/repos/janpaepke/jquery-visibility/events","assignees_url":"https://api.github.com/repos/janpaepke/jquery-visibility/assignees{/user}","branches_url":"https://api.github.com/repos/janpaepke/jquery-visibility/branches{/branch}","tags_url":"https://api.github.com/repos/janpaepke/jquery-visibility/tags","blobs_url":"https://api.github.com/repos/janpaepke/jquery-visibility/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janpaepke/jquery-visibility/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janpaepke/jquery-visibility/git/refs{/sha}","trees_url":"https://api.github.com/repos/janpaepke/jquery-visibility/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janpaepke/jquery-visibility/statuses/{sha}","languages_url":"https://api.github.com/repos/janpaepke/jquery-visibility/languages","stargazers_url":"https://api.github.com/repos/janpaepke/jquery-visibility/stargazers","contributors_url":"https://api.github.com/repos/janpaepke/jquery-visibility/contributors","subscribers_url":"https://api.github.com/repos/janpaepke/jquery-visibility/subscribers","subscription_url":"https://api.github.com/repos/janpaepke/jquery-visibility/subscription","commits_url":"https://api.github.com/repos/janpaepke/jquery-visibility/commits{/sha}","git_commits_url":"https://api.github.com/repos/janpaepke/jquery-visibility/git/commits{/sha}","comments_url":"https://api.github.com/repos/janpaepke/jquery-visibility/comments{/number}","issue_comment_url":"https://api.github.com/repos/janpaepke/jquery-visibility/issues/comments{/number}","contents_url":"https://api.github.com/repos/janpaepke/jquery-visibility/contents/{+path}","compare_url":"https://api.github.com/repos/janpaepke/jquery-visibility/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janpaepke/jquery-visibility/merges","archive_url":"https://api.github.com/repos/janpaepke/jquery-visibility/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janpaepke/jquery-visibility/downloads","issues_url":"https://api.github.com/repos/janpaepke/jquery-visibility/issues{/number}","pulls_url":"https://api.github.com/repos/janpaepke/jquery-visibility/pulls{/number}","milestones_url":"https://api.github.com/repos/janpaepke/jquery-visibility/milestones{/number}","notifications_url":"https://api.github.com/repos/janpaepke/jquery-visibility/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janpaepke/jquery-visibility/labels{/name}","releases_url":"https://api.github.com/repos/janpaepke/jquery-visibility/releases{/id}","created_at":"2014-12-02T17:51:31Z","updated_at":"2014-11-19T16:58:46Z","pushed_at":"2014-12-02T18:36:58Z","git_url":"git://github.com/janpaepke/jquery-visibility.git","ssh_url":"git@github.com:janpaepke/jquery-visibility.git","clone_url":"https://github.com/janpaepke/jquery-visibility.git","svn_url":"https://github.com/janpaepke/jquery-visibility","homepage":"https://mths.be/visibility","size":108,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"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":"mathiasbynens:master","ref":"master","sha":"62512a09c616040b76ca243ff4b43385a54f7efb","user":{"login":"mathiasbynens","id":81942,"avatar_url":"https://avatars.githubusercontent.com/u/81942?v=3","gravatar_id":"","url":"https://api.github.com/users/mathiasbynens","html_url":"https://github.com/mathiasbynens","followers_url":"https://api.github.com/users/mathiasbynens/followers","following_url":"https://api.github.com/users/mathiasbynens/following{/other_user}","gists_url":"https://api.github.com/users/mathiasbynens/gists{/gist_id}","starred_url":"https://api.github.com/users/mathiasbynens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathiasbynens/subscriptions","organizations_url":"https://api.github.com/users/mathiasbynens/orgs","repos_url":"https://api.github.com/users/mathiasbynens/repos","events_url":"https://api.github.com/users/mathiasbynens/events{/privacy}","received_events_url":"https://api.github.com/users/mathiasbynens/received_events","type":"User","site_admin":false},"repo":{"id":3268898,"name":"jquery-visibility","full_name":"mathiasbynens/jquery-visibility","owner":{"login":"mathiasbynens","id":81942,"avatar_url":"https://avatars.githubusercontent.com/u/81942?v=3","gravatar_id":"","url":"https://api.github.com/users/mathiasbynens","html_url":"https://github.com/mathiasbynens","followers_url":"https://api.github.com/users/mathiasbynens/followers","following_url":"https://api.github.com/users/mathiasbynens/following{/other_user}","gists_url":"https://api.github.com/users/mathiasbynens/gists{/gist_id}","starred_url":"https://api.github.com/users/mathiasbynens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathiasbynens/subscriptions","organizations_url":"https://api.github.com/users/mathiasbynens/orgs","repos_url":"https://api.github.com/users/mathiasbynens/repos","events_url":"https://api.github.com/users/mathiasbynens/events{/privacy}","received_events_url":"https://api.github.com/users/mathiasbynens/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mathiasbynens/jquery-visibility","description":"Page Visibility shim for jQuery","fork":false,"url":"https://api.github.com/repos/mathiasbynens/jquery-visibility","forks_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/forks","keys_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/teams","hooks_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/hooks","issue_events_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/issues/events{/number}","events_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/events","assignees_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/assignees{/user}","branches_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/branches{/branch}","tags_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/tags","blobs_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/git/refs{/sha}","trees_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/statuses/{sha}","languages_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/languages","stargazers_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/stargazers","contributors_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/contributors","subscribers_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/subscribers","subscription_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/subscription","commits_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/commits{/sha}","git_commits_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/git/commits{/sha}","comments_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/comments{/number}","issue_comment_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/issues/comments{/number}","contents_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/contents/{+path}","compare_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/merges","archive_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/downloads","issues_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/issues{/number}","pulls_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls{/number}","milestones_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/milestones{/number}","notifications_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/labels{/name}","releases_url":"https://api.github.com/repos/mathiasbynens/jquery-visibility/releases{/id}","created_at":"2012-01-25T21:46:06Z","updated_at":"2015-03-20T10:13:16Z","pushed_at":"2015-03-20T10:20:40Z","git_url":"git://github.com/mathiasbynens/jquery-visibility.git","ssh_url":"git@github.com:mathiasbynens/jquery-visibility.git","clone_url":"https://github.com/mathiasbynens/jquery-visibility.git","svn_url":"https://github.com/mathiasbynens/jquery-visibility","homepage":"https://mths.be/visibility","size":160,"stargazers_count":72,"watchers_count":72,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":8,"forks":16,"open_issues":8,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls/19"},"html":{"href":"https://github.com/mathiasbynens/jquery-visibility/pull/19"},"issue":{"href":"https://api.github.com/repos/mathiasbynens/jquery-visibility/issues/19"},"comments":{"href":"https://api.github.com/repos/mathiasbynens/jquery-visibility/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mathiasbynens/jquery-visibility/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/mathiasbynens/jquery-visibility/statuses/45efbfc550115d29c8d0aff95349e44aeabe6a96"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"janpaepke","id":3076177,"avatar_url":"https://avatars.githubusercontent.com/u/3076177?v=3","gravatar_id":"","url":"https://api.github.com/users/janpaepke","html_url":"https://github.com/janpaepke","followers_url":"https://api.github.com/users/janpaepke/followers","following_url":"https://api.github.com/users/janpaepke/following{/other_user}","gists_url":"https://api.github.com/users/janpaepke/gists{/gist_id}","starred_url":"https://api.github.com/users/janpaepke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janpaepke/subscriptions","organizations_url":"https://api.github.com/users/janpaepke/orgs","repos_url":"https://api.github.com/users/janpaepke/repos","events_url":"https://api.github.com/users/janpaepke/events{/privacy}","received_events_url":"https://api.github.com/users/janpaepke/received_events","type":"User","site_admin":false},"comments":8,"review_comments":11,"commits":4,"additions":47,"deletions":20,"changed_files":4}}