{"action":"created","issue":{"url":"https://api.github.com/repos/FolioReader/FolioReaderKit/issues/86","repository_url":"https://api.github.com/repos/FolioReader/FolioReaderKit","labels_url":"https://api.github.com/repos/FolioReader/FolioReaderKit/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/FolioReader/FolioReaderKit/issues/86/comments","events_url":"https://api.github.com/repos/FolioReader/FolioReaderKit/issues/86/events","html_url":"https://github.com/FolioReader/FolioReaderKit/pull/86","id":164677138,"number":86,"title":"Fix audio 'scroll to element' for horizontal","user":{"login":"kjantzer","id":467487,"avatar_url":"https://avatars.githubusercontent.com/u/467487?v=3","gravatar_id":"","url":"https://api.github.com/users/kjantzer","html_url":"https://github.com/kjantzer","followers_url":"https://api.github.com/users/kjantzer/followers","following_url":"https://api.github.com/users/kjantzer/following{/other_user}","gists_url":"https://api.github.com/users/kjantzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kjantzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjantzer/subscriptions","organizations_url":"https://api.github.com/users/kjantzer/orgs","repos_url":"https://api.github.com/users/kjantzer/repos","events_url":"https://api.github.com/users/kjantzer/events{/privacy}","received_events_url":"https://api.github.com/users/kjantzer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/FolioReader/FolioReaderKit/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"kjantzer","id":467487,"avatar_url":"https://avatars.githubusercontent.com/u/467487?v=3","gravatar_id":"","url":"https://api.github.com/users/kjantzer","html_url":"https://github.com/kjantzer","followers_url":"https://api.github.com/users/kjantzer/followers","following_url":"https://api.github.com/users/kjantzer/following{/other_user}","gists_url":"https://api.github.com/users/kjantzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kjantzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjantzer/subscriptions","organizations_url":"https://api.github.com/users/kjantzer/orgs","repos_url":"https://api.github.com/users/kjantzer/repos","events_url":"https://api.github.com/users/kjantzer/events{/privacy}","received_events_url":"https://api.github.com/users/kjantzer/received_events","type":"User","site_admin":false},"assignees":[{"login":"kjantzer","id":467487,"avatar_url":"https://avatars.githubusercontent.com/u/467487?v=3","gravatar_id":"","url":"https://api.github.com/users/kjantzer","html_url":"https://github.com/kjantzer","followers_url":"https://api.github.com/users/kjantzer/followers","following_url":"https://api.github.com/users/kjantzer/following{/other_user}","gists_url":"https://api.github.com/users/kjantzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kjantzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjantzer/subscriptions","organizations_url":"https://api.github.com/users/kjantzer/orgs","repos_url":"https://api.github.com/users/kjantzer/repos","events_url":"https://api.github.com/users/kjantzer/events{/privacy}","received_events_url":"https://api.github.com/users/kjantzer/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/FolioReader/FolioReaderKit/milestones/3","html_url":"https://github.com/FolioReader/FolioReaderKit/milestones/1.0","labels_url":"https://api.github.com/repos/FolioReader/FolioReaderKit/milestones/3/labels","id":1874674,"number":3,"title":"1.0","description":"This is a more stable and reliable version.","creator":{"login":"hebertialmeida","id":103670,"avatar_url":"https://avatars.githubusercontent.com/u/103670?v=3","gravatar_id":"","url":"https://api.github.com/users/hebertialmeida","html_url":"https://github.com/hebertialmeida","followers_url":"https://api.github.com/users/hebertialmeida/followers","following_url":"https://api.github.com/users/hebertialmeida/following{/other_user}","gists_url":"https://api.github.com/users/hebertialmeida/gists{/gist_id}","starred_url":"https://api.github.com/users/hebertialmeida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hebertialmeida/subscriptions","organizations_url":"https://api.github.com/users/hebertialmeida/orgs","repos_url":"https://api.github.com/users/hebertialmeida/repos","events_url":"https://api.github.com/users/hebertialmeida/events{/privacy}","received_events_url":"https://api.github.com/users/hebertialmeida/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2016-07-11T00:19:39Z","updated_at":"2016-07-11T00:34:21Z","due_on":"2016-08-31T03:00:00Z","closed_at":null},"comments":2,"created_at":"2016-07-09T17:35:16Z","updated_at":"2016-07-11T01:31:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/FolioReader/FolioReaderKit/pulls/86","html_url":"https://github.com/FolioReader/FolioReaderKit/pull/86","diff_url":"https://github.com/FolioReader/FolioReaderKit/pull/86.diff","patch_url":"https://github.com/FolioReader/FolioReaderKit/pull/86.patch"},"body":"Tested on both books."},"comment":{"url":"https://api.github.com/repos/FolioReader/FolioReaderKit/issues/comments/231624281","html_url":"https://github.com/FolioReader/FolioReaderKit/pull/86#issuecomment-231624281","issue_url":"https://api.github.com/repos/FolioReader/FolioReaderKit/issues/86","id":231624281,"user":{"login":"hebertialmeida","id":103670,"avatar_url":"https://avatars.githubusercontent.com/u/103670?v=3","gravatar_id":"","url":"https://api.github.com/users/hebertialmeida","html_url":"https://github.com/hebertialmeida","followers_url":"https://api.github.com/users/hebertialmeida/followers","following_url":"https://api.github.com/users/hebertialmeida/following{/other_user}","gists_url":"https://api.github.com/users/hebertialmeida/gists{/gist_id}","starred_url":"https://api.github.com/users/hebertialmeida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hebertialmeida/subscriptions","organizations_url":"https://api.github.com/users/hebertialmeida/orgs","repos_url":"https://api.github.com/users/hebertialmeida/repos","events_url":"https://api.github.com/users/hebertialmeida/events{/privacy}","received_events_url":"https://api.github.com/users/hebertialmeida/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T01:31:24Z","updated_at":"2016-07-11T01:31:24Z","body":"I have being playing with some code, I found a solution based on your code. I don't know if it is the best way to handle this:\r\n\r\n```\r\nfunction goToEl(el) {\r\n    var top = document.body.scrollTop;\r\n    var elTop = el.offsetTop - 20;\r\n    var bottom = window.innerHeight + document.body.scrollTop;\r\n    var elBottom = el.offsetHeight + el.offsetTop + 60\r\n\r\n    var clientWidth = document.documentElement[\"clientWidth\"];\r\n    var scrollWidth = document.body[\"scrollWidth\"];\r\n    \r\n    if (scrollWidth > clientWidth) {\r\n        var elLeft = document.body.clientWidth * Math.floor(el.offsetTop / window.innerHeight);\r\n        document.body.scrollLeft = elLeft;\r\n    } else if(elBottom > bottom || elTop < top) {\r\n        document.body.scrollTop = el.offsetTop - 20\r\n    }\r\n    \r\n    return el;\r\n}\r\n```\r\n\r\nIt is working for both orientations."}}
{"actor":{"display_login":"hebertialmeida"}}