Added a side list for characters

This commit is contained in:
Stefan Zermatten
2015-04-29 10:16:12 +02:00
parent bd6c7cd106
commit b95636a8a3
6 changed files with 56 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
.singleLineItem {
color: black;
color: rgba(0, 0, 0, 0.870588);
cursor: pointer;
font-size: 16px;
height: 40px;
overflow: hidden;
padding: 12px 0 12px 0;
text-overflow: ellipsis;
white-space: nowrap;
}

View File

@@ -0,0 +1,10 @@
<template name="characterSideList">
{{#if characters.count}}
<div class="list-subhead">Characters</div>
<div>
{{#each characters}}
<div class="singleLineItem">{{name}}</div>
{{/each}}
</div>
{{/if}}
</template>

View File

@@ -0,0 +1,25 @@
Template.characterSideList.onCreated(function() {
this.subscribe("characterList");
});
Template.characterSideList.helpers({
characters: function() {
var userId = Meteor.userId();
return Characters.find(
{
$or: [
{readers: userId},
{writers: userId},
{owner: userId},
]
},
{fields: {name: 1}}
);
}
});
Template.characterSideList.events({
"tap .singleLineItem": function(event, instance) {
Router.go("characterSheet", {_id: this._id});
}
});