{"action":"created","issue":{"url":"https://api.github.com/repos/mikeric/rivets/issues/448","labels_url":"https://api.github.com/repos/mikeric/rivets/issues/448/labels{/name}","comments_url":"https://api.github.com/repos/mikeric/rivets/issues/448/comments","events_url":"https://api.github.com/repos/mikeric/rivets/issues/448/events","html_url":"https://github.com/mikeric/rivets/pull/448","id":57208221,"number":448,"title":"Event handling: Use binding model as context","user":{"login":"Arjeno","id":352834,"avatar_url":"https://avatars.githubusercontent.com/u/352834?v=3","gravatar_id":"","url":"https://api.github.com/users/Arjeno","html_url":"https://github.com/Arjeno","followers_url":"https://api.github.com/users/Arjeno/followers","following_url":"https://api.github.com/users/Arjeno/following{/other_user}","gists_url":"https://api.github.com/users/Arjeno/gists{/gist_id}","starred_url":"https://api.github.com/users/Arjeno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arjeno/subscriptions","organizations_url":"https://api.github.com/users/Arjeno/orgs","repos_url":"https://api.github.com/users/Arjeno/repos","events_url":"https://api.github.com/users/Arjeno/events{/privacy}","received_events_url":"https://api.github.com/users/Arjeno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-10T17:36:46Z","updated_at":"2015-02-11T08:35:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mikeric/rivets/pulls/448","html_url":"https://github.com/mikeric/rivets/pull/448","diff_url":"https://github.com/mikeric/rivets/pull/448.diff","patch_url":"https://github.com/mikeric/rivets/pull/448.patch"},"body":"This is more of a question than it is a pull request. I've just started playing with rivets, it's working pretty great. There is one thing that 'feels' a bit odd, it's the context of a function that is called within events. Let me explain:\r\n\r\n**Current situation**\r\n\r\n```html\r\n<a rv-on-click=\"toggle\">Toggle me</a>\r\n<div rv-show=\"open\">Information</div>\r\n```\r\n\r\n```coffee\r\nclass SomeInterface\r\n  toggle: (event, context) ->\r\n    @open = !@open # This doesn't work because we're not in the right context\r\n    context.model.open = !context.model.open\r\n```\r\n\r\n**Situation in this pull request**\r\n\r\nGiven the same HTML as above.\r\n\r\n```coffee\r\nclass SomeInterface\r\n  toggle: (event, context) ->\r\n    @open = !@open\r\n```\r\n---\r\nIs this on purpose, am I missing something? Or am I simply doing something wrong? Would love to get some feedback."},"comment":{"url":"https://api.github.com/repos/mikeric/rivets/issues/comments/73848007","html_url":"https://github.com/mikeric/rivets/pull/448#issuecomment-73848007","issue_url":"https://api.github.com/repos/mikeric/rivets/issues/448","id":73848007,"user":{"login":"Arjeno","id":352834,"avatar_url":"https://avatars.githubusercontent.com/u/352834?v=3","gravatar_id":"","url":"https://api.github.com/users/Arjeno","html_url":"https://github.com/Arjeno","followers_url":"https://api.github.com/users/Arjeno/followers","following_url":"https://api.github.com/users/Arjeno/following{/other_user}","gists_url":"https://api.github.com/users/Arjeno/gists{/gist_id}","starred_url":"https://api.github.com/users/Arjeno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arjeno/subscriptions","organizations_url":"https://api.github.com/users/Arjeno/orgs","repos_url":"https://api.github.com/users/Arjeno/repos","events_url":"https://api.github.com/users/Arjeno/events{/privacy}","received_events_url":"https://api.github.com/users/Arjeno/received_events","type":"User","site_admin":false},"created_at":"2015-02-11T08:35:03Z","updated_at":"2015-02-11T08:35:03Z","body":"@Duder-onomy Thanks for investigating and setting up those fiddles. Looks like rivets simply copies the key/values from the original data. So the way I work with rivets (using instances) won't work. There's a pull request / discussion for this: https://github.com/mikeric/rivets/pull/417"}}