forked from laurion/fill-it
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
20 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,5 @@ | |
# but you can also edit it by hand. | ||
|
||
standard-app-packages | ||
autopublish | ||
insecure | ||
preserve-inputs |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
Items = new Meteor.Collection("items"); | ||
// Items.insert({data: []}) | ||
if (Meteor.isClient) { | ||
data = []; | ||
for(i=0;i<20;i++){ | ||
var row=[]; | ||
for(j=0;j<20;j++){ | ||
row.push({title:(i+" "+j), color: "aa"}); | ||
} | ||
data.push(row); | ||
} | ||
// Items.update({Session.get("data"):data}); | ||
Session.set("els",data); | ||
Template.table.element = function(){ | ||
console.log("wtf"); | ||
|
||
return Session.get("els"); | ||
item = Items.findOne(); | ||
return item; | ||
} | ||
Template.table.events({ | ||
"click td": function(event){ | ||
a = get[] | ||
console.log(this); | ||
item = Items.findOne(); | ||
if(item && item.value){ | ||
item.value[this.i][this.j].color="blue"; | ||
Items.update({_id:item._id},{value:item.value}); | ||
} | ||
} | ||
}); | ||
|
||
}); | ||
Meteor.subscribe("items"); | ||
|
||
} | ||
|
||
if(Meteor.isServer){ | ||
|
||
Meteor.startup(function () { | ||
// code to run on server at startup | ||
}); | ||
Meteor.publish("items", function(){ | ||
if(!Items.find().count()){ | ||
console.log("adding items"); | ||
data = []; | ||
for(i=0;i<20;i++){ | ||
var row=[]; | ||
for(j=0;j<20;j++){ | ||
row.push({i:i,j:j, color: ""}); | ||
} | ||
data.push(row); | ||
} | ||
Items.insert({value:data}); | ||
} | ||
return Items.find(); | ||
}); | ||
} | ||
|