Updated journal page to Polymer 1
This commit is contained in:
@@ -11,21 +11,36 @@ Template.noteDialog.events({
|
||||
"tap #deleteButton": function(event, instance){
|
||||
Notes.softRemove(instance.data.noteId);
|
||||
GlobalUI.deletedToast(instance.data.noteId, "Notes", "Note");
|
||||
GlobalUI.closeDetail();
|
||||
popDialogStack();
|
||||
},
|
||||
});
|
||||
|
||||
Template.noteDialogEdit.onRendered(function(){
|
||||
updatePolymerInputs(this);
|
||||
});
|
||||
const debounce = (f) => _.debounce(f, 300);
|
||||
|
||||
Template.noteDialogEdit.events({
|
||||
"change #noteNameInput, input #noteNameInput": function(event){
|
||||
"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: {name: value}});
|
||||
},
|
||||
"change #noteDescriptionInput": function(event){
|
||||
var value = event.currentTarget.value;
|
||||
Notes.update(this._id, {$set: {description: value}});
|
||||
},
|
||||
Notes.update(this._id, {
|
||||
$set: {description: value}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
trimStrings: false,
|
||||
});
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user