Moved views out of private folder
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.spellListDialog .colorDropdown {
|
||||
top: 0;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<template name="spellListDialog">
|
||||
{{#with spellList}}
|
||||
{{#baseDialog title=name class=colorClass startEditing=../startEditing}}
|
||||
<div>
|
||||
<div layout horizontal justified wrap class="subhead">
|
||||
{{#if attackBonus}}
|
||||
<div>
|
||||
Attack Bonus: {{evaluate charId attackBonus}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if saveDC}}
|
||||
<div>
|
||||
Save DC: {{evaluate charId saveDC}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if maxPrepared}}
|
||||
<div>
|
||||
Max Prepared: {{evaluateSigned charId maxPrepared}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<hr class="vertMargin">
|
||||
<div>{{#markdown}}{{evaluateString charId description}}{{/markdown}}</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<!--Name-->
|
||||
<paper-input id="spellListNameInput"
|
||||
class="fullwidth"
|
||||
label="Name"
|
||||
floatinglabel
|
||||
value={{name}}></paper-input>
|
||||
<!--Save DC-->
|
||||
<paper-input id="spellListSaveDCInput"
|
||||
label="Save DC"
|
||||
floatinglabel
|
||||
value={{saveDC}}
|
||||
style="width: 100%;"></paper-input><br>
|
||||
<!--Attack Bonus-->
|
||||
<paper-input id="spellListAttackBonusInput"
|
||||
label="Attack Bonus"
|
||||
floatinglabel
|
||||
value={{attackBonus}}
|
||||
style="width: 100%;"></paper-input><br>
|
||||
<!--Max Prepared-->
|
||||
<paper-input id="spellListMaxPreparedInput"
|
||||
label="Maximum Prepared Spells"
|
||||
floatinglabel
|
||||
value={{maxPrepared}}
|
||||
style="width: 100%;"></paper-input><br>
|
||||
<!--Description-->
|
||||
<paper-input-decorator label="Description" floatinglabel layout vertical>
|
||||
<paper-autogrow-textarea>
|
||||
<textarea id="spellListDescriptionInput" placeholder value={{description}}></textarea>
|
||||
</paper-autogrow-textarea>
|
||||
</paper-input-decorator>
|
||||
{{/baseDialog}}
|
||||
{{/with}}
|
||||
</template>
|
||||
@@ -0,0 +1,48 @@
|
||||
Template.spellListDialog.onRendered(function(){
|
||||
updatePolymerInputs(this);
|
||||
});
|
||||
|
||||
Template.spellListDialog.events({
|
||||
"color-change": function(event, instance){
|
||||
SpellLists.update(instance.data.spellListId, {$set: {color: event.color}});
|
||||
},
|
||||
"tap #deleteButton": function(event, instance){
|
||||
SpellLists.softRemoveNode(instance.data.spellListId);
|
||||
GlobalUI.deletedToast(
|
||||
instance.data.spellListId,
|
||||
"SpellLists",
|
||||
"Spell list and contents"
|
||||
);
|
||||
GlobalUI.closeDetail();
|
||||
},
|
||||
//TODO clean up String -> num here so they don't need casting by Schema.clean
|
||||
//TODO validate input (integer, non-negative, etc) for these inputs and give validation errors
|
||||
"change #spellListNameInput, input #spellListNameInput": function(event){
|
||||
var value = event.currentTarget.value;
|
||||
SpellLists.update(this._id, {$set: {name: value}});
|
||||
},
|
||||
"change #spellListSaveDCInput, input #spellListSaveDCInput": function(event){
|
||||
var value = event.currentTarget.value;
|
||||
SpellLists.update(this._id, {$set: {saveDC: value}});
|
||||
},
|
||||
"change #spellListAttackBonusInput, input #spellListAttackBonusInput":
|
||||
function(event){
|
||||
var value = event.currentTarget.value;
|
||||
SpellLists.update(this._id, {$set: {attackBonus: value}});
|
||||
},
|
||||
"change #spellListMaxPreparedInput, input #spellListMaxPreparedInput":
|
||||
function(event){
|
||||
var value = event.currentTarget.value;
|
||||
SpellLists.update(this._id, {$set: {maxPrepared: value}});
|
||||
},
|
||||
"change #spellListDescriptionInput": function(event){
|
||||
var value = event.currentTarget.value;
|
||||
SpellLists.update(this._id, {$set: {description: value}});
|
||||
},
|
||||
});
|
||||
|
||||
Template.spellListDialog.helpers({
|
||||
spellList: function(){
|
||||
return SpellLists.findOne(this.spellListId);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user