rename /rpg-docs to /app
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.noteDialog .colorDropdown {
|
||||
top: 0;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<template name="noteDialog">
|
||||
{{#with note}}
|
||||
{{#baseDialog title=name class=colorClass startEditing=../startEditing}}
|
||||
<div>{{#markdown}}{{evaluateString charId description}}{{/markdown}}</div>
|
||||
{{else}}
|
||||
{{> noteDialogEdit}}
|
||||
{{/baseDialog}}
|
||||
{{/with}}
|
||||
</template>
|
||||
|
||||
<template name="noteDialogEdit">
|
||||
<!--Name-->
|
||||
<div class="horizontal layout">
|
||||
<paper-input id="noteNameInput"
|
||||
label="Name"
|
||||
value={{name}}
|
||||
class="flex">
|
||||
</paper-input>
|
||||
</div>
|
||||
<!--Description, formatting this nicely breaks it, leave it as is-->
|
||||
<paper-textarea id="noteDescriptionInput" label="Description" value={{description}}></paper-textarea>
|
||||
</template>
|
||||
46
app/client/views/character/journal/noteDialog/noteDialog.js
Normal file
46
app/client/views/character/journal/noteDialog/noteDialog.js
Normal file
@@ -0,0 +1,46 @@
|
||||
Template.noteDialog.helpers({
|
||||
note: function(){
|
||||
return Notes.findOne(this.noteId);
|
||||
}
|
||||
});
|
||||
|
||||
Template.noteDialog.events({
|
||||
"color-change": function(event, instance){
|
||||
Notes.update(instance.data.noteId, {$set: {color: event.color}});
|
||||
},
|
||||
"tap #deleteButton": function(event, instance){
|
||||
Notes.softRemove(instance.data.noteId);
|
||||
GlobalUI.deletedToast(instance.data.noteId, "Notes", "Note");
|
||||
popDialogStack();
|
||||
},
|
||||
});
|
||||
|
||||
const debounce = (f) => _.debounce(f, 300);
|
||||
|
||||
Template.noteDialogEdit.events({
|
||||
"change #noteNameInput, input #noteNameInput": debounce(function(event){
|
||||
const input = event.currentTarget;
|
||||
var name = input.value;
|
||||
if (!name){
|
||||
input.invalid = true;
|
||||
input.errorMessage = "Name is required";
|
||||
} else {
|
||||
input.invalid = false;
|
||||
Notes.update(this._id, {
|
||||
$set: {name: name}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
trimStrings: false,
|
||||
});
|
||||
}
|
||||
}),
|
||||
"input #noteDescriptionInput": debounce(function(event){
|
||||
var value = event.currentTarget.value;
|
||||
Notes.update(this._id, {
|
||||
$set: {description: value}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
trimStrings: false,
|
||||
});
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user