Added ability to remove self from readers.

Closes #125.
This commit is contained in:
Jacob
2017-08-09 02:18:46 +01:00
parent 73d1419ee9
commit a1d9f7f5bb
5 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
Template.unshareCharacterConfirmation.onCreated(function() {
this.canUnshare = new ReactiveVar(false);
});
Template.unshareCharacterConfirmation.helpers({
cantUnshare: function() {
return !Template.instance().canUnshare.get();
},
getStyle: function() {
if (Template.instance().canUnshare.get()) {
return "background: #d23f31; color: white;";
}
}
});
Template.unshareCharacterConfirmation.events({
"change #nameInput, input #nameInput": function(event, instance) {
var can = instance.find("#nameInput").value === this.name;
instance.canUnshare.set(can);
},
"click #unshareButton": function(event, instance) {
if (instance.find("#nameInput").value === this.name) {
setTimeout(popDialogStack, 100); //weird things happen without the delay.
Router.go("/characterList");
Meteor.call("removeMeFromReaders", this._id);
}
},
"click .cancelButton": function(event, instance){
popDialogStack();
},
});