Browse Source

Commit 9-3: Clear errors after 3 seconds.

Frederic G. MARAND 9 years ago
parent
commit
f1b97c0acf
1 changed files with 8 additions and 0 deletions
  1. 8 0
      client/templates/includes/errors.js

+ 8 - 0
client/templates/includes/errors.js

@@ -12,3 +12,11 @@ Template.errors.helpers({
     return Errors.find();
   }
 });
+
+Template.error.onRendered(function () {
+  var error = this.data;
+  Meteor._debug(this.data);
+  Meteor.setTimeout(function () {
+    Errors.remove(error._id);
+  }, 3000);
+});