Last active
December 12, 2015 21:58
-
-
Save abhiaiyer91/33ce1d1a9f669e15a0ac to your computer and use it in GitHub Desktop.
Ui Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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