{"action":"created","issue":{"url":"https://api.github.com/repos/igor-alexandrov/wiselinks/issues/98","labels_url":"https://api.github.com/repos/igor-alexandrov/wiselinks/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/igor-alexandrov/wiselinks/issues/98/comments","events_url":"https://api.github.com/repos/igor-alexandrov/wiselinks/issues/98/events","html_url":"https://github.com/igor-alexandrov/wiselinks/issues/98","id":65311327,"number":98,"title":"Detect back button used","user":{"login":"amnesia7","id":1161448,"avatar_url":"https://avatars.githubusercontent.com/u/1161448?v=3","gravatar_id":"","url":"https://api.github.com/users/amnesia7","html_url":"https://github.com/amnesia7","followers_url":"https://api.github.com/users/amnesia7/followers","following_url":"https://api.github.com/users/amnesia7/following{/other_user}","gists_url":"https://api.github.com/users/amnesia7/gists{/gist_id}","starred_url":"https://api.github.com/users/amnesia7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amnesia7/subscriptions","organizations_url":"https://api.github.com/users/amnesia7/orgs","repos_url":"https://api.github.com/users/amnesia7/repos","events_url":"https://api.github.com/users/amnesia7/events{/privacy}","received_events_url":"https://api.github.com/users/amnesia7/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-30T21:58:16Z","updated_at":"2015-04-01T21:22:30Z","closed_at":"2015-04-01T21:22:30Z","body":"Is it possible to know in `page:done` that the page content is being loaded because the user clicked the back button?\r\nI can't rely on checking whether the content is being loaded using `template` or partial` because the user could have gone through a few pages loads and clicked back once, so going back from one partial to another.\r\nDoes wiselinks have this information available somehow? \r\nOr is this possible to be gathered from the `history` stack?"},"comment":{"url":"https://api.github.com/repos/igor-alexandrov/wiselinks/issues/comments/88635126","html_url":"https://github.com/igor-alexandrov/wiselinks/issues/98#issuecomment-88635126","issue_url":"https://api.github.com/repos/igor-alexandrov/wiselinks/issues/98","id":88635126,"user":{"login":"amnesia7","id":1161448,"avatar_url":"https://avatars.githubusercontent.com/u/1161448?v=3","gravatar_id":"","url":"https://api.github.com/users/amnesia7","html_url":"https://github.com/amnesia7","followers_url":"https://api.github.com/users/amnesia7/followers","following_url":"https://api.github.com/users/amnesia7/following{/other_user}","gists_url":"https://api.github.com/users/amnesia7/gists{/gist_id}","starred_url":"https://api.github.com/users/amnesia7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amnesia7/subscriptions","organizations_url":"https://api.github.com/users/amnesia7/orgs","repos_url":"https://api.github.com/users/amnesia7/repos","events_url":"https://api.github.com/users/amnesia7/events{/privacy}","received_events_url":"https://api.github.com/users/amnesia7/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T21:22:30Z","updated_at":"2015-04-01T21:22:30Z","body":"Nevermind this kind of thing seems to work:\r\n\r\n```js\r\nvar userInteraction = false;\r\n\r\n$(document).on('click', 'a[data-push], a[data-replace]', function (e) {\r\n  userInteraction = true;\r\n});\r\n// do equivalent for onsubmit of wiselinks forms as well\r\n\r\n$(document).on('page:done', function (event, $target, status, url, data) {\r\n// userInteraction = true if link clicked / form submitted\r\n// userInteraction = false if link not clicked / form not submitted\r\n});\r\n\r\n$(document).on('page:always', function (event, xhr, settings) {\r\n  userInteraction = false;\r\n});\r\n```\r\n"}}