{"action":"created","issue":{"url":"https://api.github.com/repos/patrick-steele-idem/morphdom/issues/29","repository_url":"https://api.github.com/repos/patrick-steele-idem/morphdom","labels_url":"https://api.github.com/repos/patrick-steele-idem/morphdom/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/patrick-steele-idem/morphdom/issues/29/comments","events_url":"https://api.github.com/repos/patrick-steele-idem/morphdom/issues/29/events","html_url":"https://github.com/patrick-steele-idem/morphdom/issues/29","id":116606233,"number":29,"title":"Events","user":{"login":"amirouche","id":7444897,"avatar_url":"https://avatars.githubusercontent.com/u/7444897?v=3","gravatar_id":"","url":"https://api.github.com/users/amirouche","html_url":"https://github.com/amirouche","followers_url":"https://api.github.com/users/amirouche/followers","following_url":"https://api.github.com/users/amirouche/following{/other_user}","gists_url":"https://api.github.com/users/amirouche/gists{/gist_id}","starred_url":"https://api.github.com/users/amirouche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amirouche/subscriptions","organizations_url":"https://api.github.com/users/amirouche/orgs","repos_url":"https://api.github.com/users/amirouche/repos","events_url":"https://api.github.com/users/amirouche/events{/privacy}","received_events_url":"https://api.github.com/users/amirouche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2015-11-12T18:04:58Z","updated_at":"2016-07-05T22:37:39Z","closed_at":null,"body":"How do you handle events using morphdom? "},"comment":{"url":"https://api.github.com/repos/patrick-steele-idem/morphdom/issues/comments/230623055","html_url":"https://github.com/patrick-steele-idem/morphdom/issues/29#issuecomment-230623055","issue_url":"https://api.github.com/repos/patrick-steele-idem/morphdom/issues/29","id":230623055,"user":{"login":"howardroark","id":292642,"avatar_url":"https://avatars.githubusercontent.com/u/292642?v=3","gravatar_id":"","url":"https://api.github.com/users/howardroark","html_url":"https://github.com/howardroark","followers_url":"https://api.github.com/users/howardroark/followers","following_url":"https://api.github.com/users/howardroark/following{/other_user}","gists_url":"https://api.github.com/users/howardroark/gists{/gist_id}","starred_url":"https://api.github.com/users/howardroark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/howardroark/subscriptions","organizations_url":"https://api.github.com/users/howardroark/orgs","repos_url":"https://api.github.com/users/howardroark/repos","events_url":"https://api.github.com/users/howardroark/events{/privacy}","received_events_url":"https://api.github.com/users/howardroark/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T22:37:39Z","updated_at":"2016-07-05T22:37:39Z","body":"Ok I got something working if anyone is curious...\r\n\r\n```\r\nwindow.morphdomEventsDump = [];\r\nmorphdom(this.currentAncestorEl, this.el, {\r\n    onBeforeElUpdated: function(fromEl, toEl) {\r\n        var events = $._data(toEl, \"events\");\r\n        if(events) {\r\n            window.morphdomEventsDump.push(events);\r\n            toEl.setAttribute('data-morphdomeventsdump', window.morphdomEventsDump.length - 1);\r\n        }\r\n    },\r\n    onElUpdated: function(el) {\r\n        var events = window.morphdomEventsDump[el.getAttribute('data-morphdomeventsdump')];\r\n        if(typeof events != 'undefined') {\r\n            for(var eventName in events) {\r\n                for(var i = 0; i < events[eventName].length; i++) {\r\n                    var eventObject = events[eventName][i];\r\n                    $(el).on(eventObject.type, eventObject.selector, eventObject.handler);\r\n                }\r\n            }\r\n        }\r\n    }\r\n})\r\n```"}}
{"actor":{"display_login":"howardroark"}}