Almost full circle

This commit is contained in:
Angelo Gallarello 2018-08-15 18:47:09 +02:00
parent 93cc7f0232
commit 9b0eb0a9f1
24 changed files with 492 additions and 165 deletions

View file

@ -0,0 +1,22 @@
template(name="boardActions")
div.trigger-item
div.trigger-content
div.trigger-text
| Move card to
div.trigger-dropdown
select(id="action")
option(value="top") Top of
option(value="bottom") Bottom of
div.trigger-text
| list
div.trigger-dropdown
input(type=text,placeholder="List Name")
div.trigger-button.js-add-move-action.js-goto-rules
i.fa.fa-plus

View file

@ -0,0 +1,32 @@
BlazeComponent.extendComponent({
onCreated() {
},
events() {
return [
{'click .js-add-move-action'(event) {
console.log(this.data());
console.log(this.data().triggerIdVar.get());
const ruleName = this.data().ruleName.get();
const triggerId = this.data().triggerIdVar.get();
const actionSelected = this.find('#action').value;
if(actionSelected == "top"){
Actions.insert({actionType: "moveCardToTop"},function(err,id){
Rules.insert({title: ruleName, triggerId: triggerId, actionId: id});
});
}
if(actionSelected == "bottom"){
Actions.insert({actionType: "moveCardToBottom"},function(err,id){
Rules.insert({title: ruleName, triggerId: triggerId, actionId: id});
});
}
},
}];
},
}).register('boardActions');