Added the ability to hide the spells tab for a character

This commit is contained in:
Stefan Zermatten
2015-05-27 08:10:14 +02:00
parent 5b8c25f5de
commit 90e511eb00
5 changed files with 40 additions and 7 deletions

View File

@@ -1,13 +1,26 @@
<template name="characterSettings">
{{#with character}}
<div>
<div layout horizontal>
<div>Use variant encumbrance </div>
<paper-toggle-button id="variantEncumbrance"
checked={{settings.useVariantEncumbrance}}
touch-action="pan-y">
</paper-toggle-button>
</div>
<table>
<tr>
<td>Hide Spells tab</td>
<td>
<paper-toggle-button id="hideSpellcasting"
checked={{settings.hideSpellcasting}}
touch-action="pan-y">
</paper-toggle-button>
</td>
</tr>
<tr>
<td>Use variant encumbrance</td>
<td>
<paper-toggle-button id="variantEncumbrance"
checked={{settings.useVariantEncumbrance}}
touch-action="pan-y">
</paper-toggle-button>
</td>
</tr>
</table>
</div>
{{/with}}
</template>

View File

@@ -14,4 +14,13 @@ Template.characterSettings.events({
);
}
},
"change #hideSpellcasting": function(event, instance){
var value = instance.find("#hideSpellcasting").checked;
if (this.settings.hideSpellcasting !== value){
Characters.update(
this._id,
{$set: {"settings.hideSpellcasting": value}}
);
}
},
});