{"action":"created","issue":{"url":"https://api.github.com/repos/ryanpcmcquen/scrollEvents/issues/8","labels_url":"https://api.github.com/repos/ryanpcmcquen/scrollEvents/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/ryanpcmcquen/scrollEvents/issues/8/comments","events_url":"https://api.github.com/repos/ryanpcmcquen/scrollEvents/issues/8/events","html_url":"https://github.com/ryanpcmcquen/scrollEvents/pull/8","id":111379209,"number":8,"title":"when* methods added: when, whenDistance, whenElement, etc","user":{"login":"Tarabyte","id":2027010,"avatar_url":"https://avatars.githubusercontent.com/u/2027010?v=3","gravatar_id":"","url":"https://api.github.com/users/Tarabyte","html_url":"https://github.com/Tarabyte","followers_url":"https://api.github.com/users/Tarabyte/followers","following_url":"https://api.github.com/users/Tarabyte/following{/other_user}","gists_url":"https://api.github.com/users/Tarabyte/gists{/gist_id}","starred_url":"https://api.github.com/users/Tarabyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tarabyte/subscriptions","organizations_url":"https://api.github.com/users/Tarabyte/orgs","repos_url":"https://api.github.com/users/Tarabyte/repos","events_url":"https://api.github.com/users/Tarabyte/events{/privacy}","received_events_url":"https://api.github.com/users/Tarabyte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-14T11:30:42Z","updated_at":"2015-10-14T15:51:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ryanpcmcquen/scrollEvents/pulls/8","html_url":"https://github.com/ryanpcmcquen/scrollEvents/pull/8","diff_url":"https://github.com/ryanpcmcquen/scrollEvents/pull/8.diff","patch_url":"https://github.com/ryanpcmcquen/scrollEvents/pull/8.patch"},"body":"`when*` methods were added to spy instance.\r\n- `when(breakPoint /*, rest*/)` - polymorphic method that accepts numbers, strings and even functions as a breakpoint;\r\n- `whenDistance(distance)` - accepts numbers as a break point;\r\n- `whenElement(selector, hitsTop: false)` - accepts string selector as a break point, triggers when element enters the viewport, unless `hitsTop` is `true`;\r\n- `whenElementHitsTop(selector)` - alias for `whenElement(selector, true)`;\r\n- `whenElementEnters(selector)` - alias for `whenElement(selector, false)`;\r\n\r\n\r\n# Usage\r\n```javascript\r\nscrollEvents('.foo')\r\n   .whenDistance(10).changeClass('unscrolled', 'scrolled10')\r\n   .whenElementEnters('.bar').changeText('unscrolled', '.bar enters the viewport')\r\n   .whenElementHitsTop('.bar').changeText('.bar enters the viewport', '.bar hits top');\r\n```"},"comment":{"url":"https://api.github.com/repos/ryanpcmcquen/scrollEvents/issues/comments/148094485","html_url":"https://github.com/ryanpcmcquen/scrollEvents/pull/8#issuecomment-148094485","issue_url":"https://api.github.com/repos/ryanpcmcquen/scrollEvents/issues/8","id":148094485,"user":{"login":"ryanpcmcquen","id":772937,"avatar_url":"https://avatars.githubusercontent.com/u/772937?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanpcmcquen","html_url":"https://github.com/ryanpcmcquen","followers_url":"https://api.github.com/users/ryanpcmcquen/followers","following_url":"https://api.github.com/users/ryanpcmcquen/following{/other_user}","gists_url":"https://api.github.com/users/ryanpcmcquen/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanpcmcquen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanpcmcquen/subscriptions","organizations_url":"https://api.github.com/users/ryanpcmcquen/orgs","repos_url":"https://api.github.com/users/ryanpcmcquen/repos","events_url":"https://api.github.com/users/ryanpcmcquen/events{/privacy}","received_events_url":"https://api.github.com/users/ryanpcmcquen/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T15:51:54Z","updated_at":"2015-10-14T15:51:54Z","body":"Ha. Well you JavaScript makes me feel like a noob.  :wink:\r\n\r\nThis is what I would do, seems to work here:\r\n```\r\ngit clone git@github.com:Tarabyte/scrollEvents.git\r\ncd scrollEvents/\r\ngit checkout when-api\r\ngit remote add upstream git@github.com:ryanpcmcquen/scrollEvents.git\r\ngit pull --rebase upstream useViewportHeight\r\n```\r\n\r\nThen you can resolve the merge conflicts using something like `git mergetool`."}}