2012-09-20 08:56:44 +09:00
|
|
|
Template.error.message= function(){
|
2012-10-05 22:09:13 +09:00
|
|
|
var outerContext = Meteor.deps.Context.current;
|
|
|
|
var innerContext = new Meteor.deps.Context;
|
|
|
|
var error;
|
|
|
|
|
|
|
|
innerContext.onInvalidate(function() {
|
|
|
|
// we don't need to send the invalidate through anymore if post is set
|
|
|
|
error || outerContext.invalidate();
|
|
|
|
});
|
|
|
|
|
|
|
|
innerContext.run(function() {
|
|
|
|
error = Session.get("error");
|
|
|
|
});
|
|
|
|
|
|
|
|
return error;
|
2012-09-21 07:51:47 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
Template.error.rendered = function(){
|
2012-10-05 22:09:13 +09:00
|
|
|
Meteor.setTimeout(function(){
|
|
|
|
Session.set("error", null);
|
|
|
|
}, 100);
|
2012-09-20 08:56:44 +09:00
|
|
|
}
|