{"action":"created","issue":{"url":"https://api.github.com/repos/MeteorStuff/meteor-materialize-modal/issues/1","labels_url":"https://api.github.com/repos/MeteorStuff/meteor-materialize-modal/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/MeteorStuff/meteor-materialize-modal/issues/1/comments","events_url":"https://api.github.com/repos/MeteorStuff/meteor-materialize-modal/issues/1/events","html_url":"https://github.com/MeteorStuff/meteor-materialize-modal/pull/1","id":110833392,"number":1,"title":"Upgrades to Event & Context Handling","user":{"login":"msolters","id":4452380,"avatar_url":"https://avatars.githubusercontent.com/u/4452380?v=3","gravatar_id":"","url":"https://api.github.com/users/msolters","html_url":"https://github.com/msolters","followers_url":"https://api.github.com/users/msolters/followers","following_url":"https://api.github.com/users/msolters/following{/other_user}","gists_url":"https://api.github.com/users/msolters/gists{/gist_id}","starred_url":"https://api.github.com/users/msolters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msolters/subscriptions","organizations_url":"https://api.github.com/users/msolters/orgs","repos_url":"https://api.github.com/users/msolters/repos","events_url":"https://api.github.com/users/msolters/events{/privacy}","received_events_url":"https://api.github.com/users/msolters/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MeteorStuff/meteor-materialize-modal/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"msolters","id":4452380,"avatar_url":"https://avatars.githubusercontent.com/u/4452380?v=3","gravatar_id":"","url":"https://api.github.com/users/msolters","html_url":"https://github.com/msolters","followers_url":"https://api.github.com/users/msolters/followers","following_url":"https://api.github.com/users/msolters/following{/other_user}","gists_url":"https://api.github.com/users/msolters/gists{/gist_id}","starred_url":"https://api.github.com/users/msolters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msolters/subscriptions","organizations_url":"https://api.github.com/users/msolters/orgs","repos_url":"https://api.github.com/users/msolters/repos","events_url":"https://api.github.com/users/msolters/events{/privacy}","received_events_url":"https://api.github.com/users/msolters/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-10-11T04:39:50Z","updated_at":"2015-10-12T00:03:59Z","closed_at":"2015-10-11T23:06:51Z","pull_request":{"url":"https://api.github.com/repos/MeteorStuff/meteor-materialize-modal/pulls/1","html_url":"https://github.com/MeteorStuff/meteor-materialize-modal/pull/1","diff_url":"https://github.com/MeteorStuff/meteor-materialize-modal/pull/1.diff","patch_url":"https://github.com/MeteorStuff/meteor-materialize-modal/pull/1.patch"},"body":"For a concise demonstration of the improvements I have implemented here, please see the added example:  http://materializemodal.meteor.com/#custom-example\r\n\r\nThe idea is to let users define modal logic in the bodyTemplate's `events({})` like any other Meteor template, so they do not get stuck with callbacks.\r\n\r\n## Problem Description\r\n\r\nWhile implementing some basic use cases with this package, I came across two common problems.\r\n\r\n1.  `footerTemplate` cannot access `bodyTemplate`'s data context.\r\n1.  Very often a user might have events which depend on elements contained in `bodyTemplate`, but *triggered* by buttons contained inside `footerTemplate` -- which are disjoint templates.\r\n\r\n**In a nutshell, I wanted to make it super easy for a user to write `bodyTemplate` event maps that can depend on buttons from the footer.**\r\n\r\n## Solutions\r\n\r\n1.  I have removed the superfluous `footerTemplateData` field -- footers now inherit the same transparent data context that everything else in the modal does.  Whatever static or reactive data gets passed in is easily accessible by `{{varName}}` reference in both `bodyTemplate` and `footerTemplate`.\r\n1.  I have added 2 lines of code that cause the `Template.materializeModal` template to inherit and handle the events from `bodyTemplate`.  Since `Template.materializeModal` contains both the `footerTemplate` and `bodyTemplate`, the user can write event maps for their `bodyTemplate` that will \"automatically\" handle all aspects of modal logic (if the user wants).  This is far more Meteoric than trying to pass data contexts through callbacks, et cetera."},"comment":{"url":"https://api.github.com/repos/MeteorStuff/meteor-materialize-modal/issues/comments/147257329","html_url":"https://github.com/MeteorStuff/meteor-materialize-modal/pull/1#issuecomment-147257329","issue_url":"https://api.github.com/repos/MeteorStuff/meteor-materialize-modal/issues/1","id":147257329,"user":{"login":"msolters","id":4452380,"avatar_url":"https://avatars.githubusercontent.com/u/4452380?v=3","gravatar_id":"","url":"https://api.github.com/users/msolters","html_url":"https://github.com/msolters","followers_url":"https://api.github.com/users/msolters/followers","following_url":"https://api.github.com/users/msolters/following{/other_user}","gists_url":"https://api.github.com/users/msolters/gists{/gist_id}","starred_url":"https://api.github.com/users/msolters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msolters/subscriptions","organizations_url":"https://api.github.com/users/msolters/orgs","repos_url":"https://api.github.com/users/msolters/repos","events_url":"https://api.github.com/users/msolters/events{/privacy}","received_events_url":"https://api.github.com/users/msolters/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T00:03:59Z","updated_at":"2015-10-12T00:03:59Z","body":"http://materializemodal.meteor.com should be even with the latest published version of `meteorstuff:materialize-modal` now."}}