Skip to content

Instantly share code, notes, and snippets.

@abhiaiyer91
Last active December 12, 2015 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhiaiyer91/33ce1d1a9f669e15a0ac to your computer and use it in GitHub Desktop.
Save abhiaiyer91/33ce1d1a9f669e15a0ac to your computer and use it in GitHub Desktop.
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