Skip to content

Instantly share code, notes, and snippets.

@abhiaiyer91
Last active Dec 12, 2015
Embed
What would you like to do?
Ui Example
'click .submit': function (event, template) {
var post = template.data.post;
// Lets do more presentational stuff //
$(template.find(‘button[type=submit])).addClass(‘loading’);
$(template.find(‘input,textarea’)).not(:disabled”).addClass(“disabled”).prop(“disabled”, true);
// Lets also check if you're logged in here
if (!Meteor.userId()) {
return ShowToast('Some Message', 'error')
}
// lets run some callbacks
post = Callbacks.run(“postSubmitClient”, post);
// lets do more stuff
template.subscribe('singlePost', post._id, function () {
$(template.find('button[type=submit]')(.removeClass('loading');
FlowRouter.go('postPage', post);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment