# HG changeset patch # User Fadi Abbud # Date 1565944157 -7200 # Node ID 36ee7e6211336b1d7748a6903ab5433437cc55c4 # Parent b0bb1b6246787a5f29bdd2b286a8cc4b326ef296 styles-config: impelement rest-send buttons for all style changes diff -r b0bb1b624678 -r 36ee7e621133 client/src/components/systemconfiguration/ColorSettings.vue --- a/client/src/components/systemconfiguration/ColorSettings.vue Thu Aug 15 16:58:39 2019 +0200 +++ b/client/src/components/systemconfiguration/ColorSettings.vue Fri Aug 16 10:29:17 2019 +0200 @@ -36,6 +36,18 @@ +
+ Reset all to defaults + + +
@@ -132,6 +144,16 @@ "compact-picker": Compact }, methods: { + saveAll() { + this.features.forEach(f => { + this.submit(f); + }); + }, + resetAll() { + this.features.forEach(f => { + this.reset(f); + }); + }, reset(feature) { switch (feature.name) { case "Bottlenecks": { @@ -177,17 +199,17 @@ } } }, - noChangeMsg(name) { - displayInfo({ - title: name + ":", - message: this.$gettext("No style-changes") - }); - }, submit(feature) { let strokeC = feature.strokeColor.hex8 || feature.strokeColor, fillC = feature.fillColor ? feature.fillColor.hex8 || feature.fillColor : initFColor; + let noChangeMsg = name => { + displayInfo({ + title: name + ":", + message: this.$gettext("No style-changes") + }); + }; switch (feature.name) { case "Bottlenecks": { // send values only if they changed @@ -202,7 +224,7 @@ }) .finally(() => this.$store.dispatch("application/loadConfig")); } else { - this.noChangeMsg(feature.name); + noChangeMsg(feature.name); } break; } @@ -218,7 +240,7 @@ }) .finally(() => this.$store.dispatch("application/loadConfig")); } else { - this.noChangeMsg(feature.name); + noChangeMsg(feature.name); } break; } @@ -234,7 +256,7 @@ }) .finally(() => this.$store.dispatch("application/loadConfig")); } else { - this.noChangeMsg(feature.name); + noChangeMsg(feature.name); } break; } @@ -250,7 +272,7 @@ }) .finally(() => this.$store.dispatch("application/loadConfig")); } else { - this.noChangeMsg(feature.name); + noChangeMsg(feature.name); } break; } @@ -266,7 +288,7 @@ }) .finally(() => this.$store.dispatch("application/loadConfig")); } else { - this.noChangeMsg(feature.name); + noChangeMsg(feature.name); } break; } @@ -282,7 +304,7 @@ }) .finally(() => this.$store.dispatch("application/loadConfig")); } else { - this.noChangeMsg(feature.name); + noChangeMsg(feature.name); } break; } @@ -296,7 +318,7 @@ this.$store.dispatch("application/loadConfig"); }); } else { - this.noChangeMsg(feature.name); + noChangeMsg(feature.name); } break; }