From 6c6616ca1955e0334199fe67118e2834b2b35b5a Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 12 Mar 2018 17:40:19 -0700 Subject: [PATCH] Improve performance of sliding smoothing slider by debouncing value --- frontend/src/scalars/ui/Config.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/scalars/ui/Config.vue b/frontend/src/scalars/ui/Config.vue index 6c061cb6f..b07479aff 100644 --- a/frontend/src/scalars/ui/Config.vue +++ b/frontend/src/scalars/ui/Config.vue @@ -12,10 +12,10 @@ :max="0.99" :min="0" :step="0.01" - v-model="config.smoothing" + v-model="smoothingValue" class="visual-dl-page-smoothing-slider" dark> - {{config.smoothing}} + {{smoothingValue}} @@ -80,9 +80,17 @@ export default { ], sortingMethodItems: [ 'default', 'descending', 'ascending', 'nearest' - ] + ], + smoothingValue: this.config.smoothing }; }, + watch: { + smoothingValue: _.debounce( + function() { + this.config.smoothing = this.smoothingValue; + }, 50 + ) + }, methods: { toggleAllRuns() { this.config.running = !this.config.running;