mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Almost full circle
This commit is contained in:
parent
93cc7f0232
commit
9b0eb0a9f1
24 changed files with 492 additions and 165 deletions
62
client/components/rules/rulesMain.js
Normal file
62
client/components/rules/rulesMain.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.rulesListVar = new ReactiveVar(true);
|
||||
this.rulesTriggerVar = new ReactiveVar(false);
|
||||
this.rulesActionVar = new ReactiveVar(false);
|
||||
this.ruleName = new ReactiveVar("");
|
||||
this.triggerIdVar = new ReactiveVar("");
|
||||
},
|
||||
|
||||
setTrigger() {
|
||||
this.rulesListVar.set(false);
|
||||
this.rulesTriggerVar.set(true);
|
||||
this.rulesActionVar.set(false);
|
||||
},
|
||||
|
||||
setRulesList() {
|
||||
this.rulesListVar.set(true);
|
||||
this.rulesTriggerVar.set(false);
|
||||
this.rulesActionVar.set(false);
|
||||
},
|
||||
|
||||
setAction() {
|
||||
this.rulesListVar.set(false);
|
||||
this.rulesTriggerVar.set(false);
|
||||
this.rulesActionVar.set(true);
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{'click .js-delete-rule'(event) {
|
||||
const rule = this.currentData();
|
||||
Rules.remove(rule._id);
|
||||
|
||||
},
|
||||
'click .js-goto-trigger'(event) {
|
||||
event.preventDefault();
|
||||
const ruleTitle = this.find('#ruleTitle').value;
|
||||
this.find('#ruleTitle').value = "";
|
||||
this.ruleName.set(ruleTitle)
|
||||
this.setTrigger();
|
||||
},
|
||||
'click .js-goto-action'(event) {
|
||||
event.preventDefault();
|
||||
this.setAction();
|
||||
},
|
||||
'click .js-goto-rules'(event) {
|
||||
event.preventDefault();
|
||||
this.setRulesList();
|
||||
},
|
||||
|
||||
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('rulesMain');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue