Persona dialogs now correctly update their input fields
This commit is contained in:
@@ -2,13 +2,17 @@
|
|||||||
{{#baseDialog title=name class="deep-purple white-text" hideColor="true" hideDelete="true" startEditing=startEditing}}
|
{{#baseDialog title=name class="deep-purple white-text" hideColor="true" hideDelete="true" startEditing=startEditing}}
|
||||||
{{alignment}} {{gender}} {{race}}
|
{{alignment}} {{gender}} {{race}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<!--Name-->
|
{{> personaDetailsEdit}}
|
||||||
<paper-input id="nameInput" label="Name" floatinglabel value={{name}}></paper-input><br>
|
|
||||||
<!--Alignment-->
|
|
||||||
<paper-input id="alignmentInput" label="Alignment" floatinglabel value={{alignment}}></paper-input><br>
|
|
||||||
<!--Gender-->
|
|
||||||
<paper-input id="genderInput" label="Gender" floatinglabel value={{gender}}></paper-input><br>
|
|
||||||
<!--Race-->
|
|
||||||
<paper-input id="raceInput" label="Race" floatinglabel value={{race}}></paper-input><br>
|
|
||||||
{{/baseDialog}}
|
{{/baseDialog}}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template name="personaDetailsEdit">
|
||||||
|
<!--Name-->
|
||||||
|
<paper-input id="nameInput" label="Name" floatinglabel value={{name}}></paper-input><br>
|
||||||
|
<!--Alignment-->
|
||||||
|
<paper-input id="alignmentInput" label="Alignment" floatinglabel value={{alignment}}></paper-input><br>
|
||||||
|
<!--Gender-->
|
||||||
|
<paper-input id="genderInput" label="Gender" floatinglabel value={{gender}}></paper-input><br>
|
||||||
|
<!--Race-->
|
||||||
|
<paper-input id="raceInput" label="Race" floatinglabel value={{race}}></paper-input><br>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
Template.personaDetailsDialog.onRendered(function(){
|
Template.personaDetailsEdit.onRendered(function(){
|
||||||
updatePolymerInputs(this);
|
updatePolymerInputs(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.personaDetailsDialog.events({
|
Template.personaDetailsEdit.events({
|
||||||
"change #nameInput": function(event){
|
"change #nameInput": function(event){
|
||||||
var input = event.currentTarget.value;
|
var input = event.currentTarget.value;
|
||||||
Characters.update(this.charId, {$set: {name: input}});
|
Characters.update(this.charId, {$set: {name: input}});
|
||||||
|
|||||||
@@ -2,10 +2,14 @@
|
|||||||
{{#baseDialog title=title class=colorClass hideColor="true" hideDelete="true" startEditing=startEditing}}
|
{{#baseDialog title=title class=colorClass hideColor="true" hideDelete="true" startEditing=startEditing}}
|
||||||
<div class="prewrap">{{value}}</div>
|
<div class="prewrap">{{value}}</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<paper-input-decorator label={{title}} floatinglabel layout vertical>
|
{{> textDialogEdit}}
|
||||||
<paper-autogrow-textarea>
|
|
||||||
<textarea id="textInput" placeholder value={{value}}></textarea>
|
|
||||||
</paper-autogrow-textarea>
|
|
||||||
</paper-input-decorator>
|
|
||||||
{{/baseDialog}}
|
{{/baseDialog}}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template name="textDialogEdit">
|
||||||
|
<paper-input-decorator label={{title}} floatinglabel layout vertical>
|
||||||
|
<paper-autogrow-textarea>
|
||||||
|
<textarea id="textInput" placeholder value={{value}}></textarea>
|
||||||
|
</paper-autogrow-textarea>
|
||||||
|
</paper-input-decorator>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
Template.textDialog.onRendered(function(){
|
|
||||||
updatePolymerInputs(this);
|
|
||||||
});
|
|
||||||
|
|
||||||
Template.textDialog.helpers({
|
Template.textDialog.helpers({
|
||||||
value: function(){
|
value: function(){
|
||||||
var fieldSelector = {fields: {}};
|
var fieldSelector = {fields: {}};
|
||||||
@@ -11,7 +7,20 @@ Template.textDialog.helpers({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.textDialog.events({
|
Template.textDialogEdit.onRendered(function(){
|
||||||
|
updatePolymerInputs(this);
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.textDialogEdit.helpers({
|
||||||
|
value: function(){
|
||||||
|
var fieldSelector = {fields: {}};
|
||||||
|
fieldSelector.fields[this.field] = 1;
|
||||||
|
var char = Characters.findOne(this.charId, fieldSelector);
|
||||||
|
return char[this.field];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.textDialogEdit.events({
|
||||||
"change #textInput": function(event){
|
"change #textInput": function(event){
|
||||||
var input = event.currentTarget.value;
|
var input = event.currentTarget.value;
|
||||||
var setter = {$set: {}};
|
var setter = {$set: {}};
|
||||||
|
|||||||
Reference in New Issue
Block a user