From 754c9767358430c7dc42c9e02af051cf7549597d Mon Sep 17 00:00:00 2001 From: Stanislav Romanov Date: Fri, 15 Apr 2022 17:42:17 +0300 Subject: [PATCH] Add removing sort by click --- app/controllers/admin/indexes/item/data.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/indexes/item/data.js b/app/controllers/admin/indexes/item/data.js index 596aaea..957a765 100644 --- a/app/controllers/admin/indexes/item/data.js +++ b/app/controllers/admin/indexes/item/data.js @@ -38,7 +38,9 @@ export default class AdminIndexesItemDataController extends Controller { @action onSort(newSort) { - if (`${newSort}:asc` === this.sort) { + if (`${newSort}:desc` === this.sort) { + this.sort = null; + } else if (`${newSort}:asc` === this.sort) { this.sort = `${newSort}:desc`; } else { this.sort = `${newSort}:asc`;