From 739c2ebebfa0a0cd1dd4868fc2d2c67bf142f8f5 Mon Sep 17 00:00:00 2001 From: Sevan Nerse Date: Fri, 26 Feb 2021 12:25:52 +0300 Subject: [PATCH] values of selected filters are arranged #1869 --- .../assets/js/components/AkauntingSearch.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/resources/assets/js/components/AkauntingSearch.vue b/resources/assets/js/components/AkauntingSearch.vue index ecec97864..a0dbe35bc 100644 --- a/resources/assets/js/components/AkauntingSearch.vue +++ b/resources/assets/js/components/AkauntingSearch.vue @@ -630,16 +630,18 @@ export default { this.option_values[_filter.key] = filter_values; - filter_values.forEach(function (value, j) { - if (value.key == filter[1]) { - this.selected_values.push(value); + if (filter_values.length > 0) { + filter_values.forEach(function (value, j) { + if (value.key == filter[1]) { + this.selected_values.push(value); - this.option_values[_filter.key].splice(j, 1); + this.option_values[_filter.key].splice(j, 1); + } + }, this); + } else { + if (cookie != undefined && cookie[_filter.key]) { + this.selected_values.push(cookie[_filter.key]); } - }, this); - - if (cookie != undefined && cookie[_filter.key]) { - this.selected_values.push(cookie[_filter.key]); } } }, this);