mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-30 17:15:16 +02:00
refresh then change classes for list/grid view
This commit is contained in:
parent
ca4378e41d
commit
e0524b73d9
@ -1979,16 +1979,18 @@ class NavWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_item_display() {
|
async switch_item_display() {
|
||||||
var button = document.getElementById("nav-item-display-icon");
|
var button = document.getElementById("nav-item-display-icon");
|
||||||
if (this.item_display === "grid") {
|
if (this.item_display === "grid") {
|
||||||
this.item_display = "list";
|
this.item_display = "list";
|
||||||
|
await this.refresh();
|
||||||
this.window.classList.remove("contents-view-grid");
|
this.window.classList.remove("contents-view-grid");
|
||||||
this.window.classList.add("contents-view-list");
|
this.window.classList.add("contents-view-list");
|
||||||
button.classList.remove("fa-list");
|
button.classList.remove("fa-list");
|
||||||
button.classList.add("fa-th");
|
button.classList.add("fa-th");
|
||||||
} else {
|
} else {
|
||||||
this.item_display = "grid";
|
this.item_display = "grid";
|
||||||
|
await this.refresh();
|
||||||
this.window.classList.remove("contents-view-list");
|
this.window.classList.remove("contents-view-list");
|
||||||
this.window.classList.add("contents-view-grid");
|
this.window.classList.add("contents-view-grid");
|
||||||
button.classList.remove("fa-th");
|
button.classList.remove("fa-th");
|
||||||
@ -1996,8 +1998,6 @@ class NavWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
localStorage.setItem("item-display", this.item_display);
|
localStorage.setItem("item-display", this.item_display);
|
||||||
|
|
||||||
this.refresh();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user