From e0524b73d9454244efd7137efcfee4bf1e4e8276 Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Mon, 7 Jun 2021 17:15:14 -0300 Subject: [PATCH] refresh then change classes for list/grid view --- navigator/navigator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/navigator/navigator.js b/navigator/navigator.js index 47e5bf6..93ee088 100644 --- a/navigator/navigator.js +++ b/navigator/navigator.js @@ -1979,16 +1979,18 @@ class NavWindow { } } - switch_item_display() { + async switch_item_display() { var button = document.getElementById("nav-item-display-icon"); if (this.item_display === "grid") { this.item_display = "list"; + await this.refresh(); this.window.classList.remove("contents-view-grid"); this.window.classList.add("contents-view-list"); button.classList.remove("fa-list"); button.classList.add("fa-th"); } else { this.item_display = "grid"; + await this.refresh(); this.window.classList.remove("contents-view-list"); this.window.classList.add("contents-view-grid"); button.classList.remove("fa-th"); @@ -1996,8 +1998,6 @@ class NavWindow { } localStorage.setItem("item-display", this.item_display); - - this.refresh(); } }