Commit 541c8da0 authored by Regis's avatar Regis

make toggle switch for flags

parent 62f7b206
...@@ -51,6 +51,10 @@ export default { ...@@ -51,6 +51,10 @@ export default {
}; };
}, },
methods: { methods: {
updateFlag(key, toggle) {
this[key].pre = toggle;
this[key].pulse = !toggle;
},
renderResponse(res) { renderResponse(res) {
this.apiData = res.json(); this.apiData = res.json();
this.triggerAnimation(); this.triggerAnimation();
...@@ -61,8 +65,7 @@ export default { ...@@ -61,8 +65,7 @@ export default {
elementsToVisualize(noTitleChange, noDescriptionChange) { elementsToVisualize(noTitleChange, noDescriptionChange) {
if (!noTitleChange) { if (!noTitleChange) {
this.titleText = this.apiData.title_text; this.titleText = this.apiData.title_text;
this.titleFlag.pre = true; this.updateFlag('titleFlag', true);
this.titleFlag.pulse = false;
} }
if (!noDescriptionChange) { if (!noDescriptionChange) {
...@@ -70,8 +73,7 @@ export default { ...@@ -70,8 +73,7 @@ export default {
this.descriptionChange = true; this.descriptionChange = true;
this.updateTaskHTML(); this.updateTaskHTML();
this.tasks = this.apiData.task_status; this.tasks = this.apiData.task_status;
this.descriptionFlag.pre = true; this.updateFlag('descriptionFlag', true);
this.descriptionFlag.pulse = false;
} }
}, },
setTabTitle() { setTabTitle() {
...@@ -85,10 +87,8 @@ export default { ...@@ -85,10 +87,8 @@ export default {
this.setTabTitle(); this.setTabTitle();
this.$nextTick(() => { this.$nextTick(() => {
this.titleFlag.pre = false; this.updateFlag('titleFlag', false);
this.titleFlag.pulse = true; this.updateFlag('descriptionFlag', false);
this.descriptionFlag.pre = false;
this.descriptionFlag.pulse = true;
}); });
}, },
triggerAnimation() { triggerAnimation() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment