Permalink
Browse files

Code commenting and formatting.

  • Loading branch information...
srackham committed Nov 5, 2012
1 parent 40b4fa9 commit c5a84744328d59354444648a9e43648458b19377
Showing with 10 additions and 5 deletions.
  1. +4 −0 client/main.ts
  2. +6 −5 common/model.ts
View
@@ -83,10 +83,14 @@ module Client {
},
'click': function() {
+ // To prevent zombie tooltips from occuring when the corresponding DOM
+ // elements are deleted or moved.
$('.tooltip').remove();
}
};
+ // Called to update tooltips each time the template is rendered. Execution is
+ // deferred until the template has been rendered.
Template.player.enable_tooltips = function() {
_.defer(
() => { $('[rel=tooltip]').tooltip(); }
View
@@ -27,17 +27,18 @@ module Model {
'Issac Newton'
];
function handleError(err) {
- if (errback)
- errback(err);
- else
- console.log(err.reason);
+ if (errback)
+ errback(err);
+ else
+ console.log(err.reason);
};
Players.remove({}, function(err) {
if (err) {
handleError(err);
} else {
for (var i in names) {
- Players.insert({
+ Players.insert(
+ {
name: names[i],
score: Math.floor(Math.random() * 10) * 5
},

0 comments on commit c5a8474

Please sign in to comment.