Skip to content

Commit ac95471

Browse files
authored
🔀 Merge pull request #89 from geriyoco/main
🚀 v0.4.1
2 parents 914af8a + b3d28c9 commit ac95471

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [0.4.1] - 2022-08-01
4+
### Fixed
5+
- Buttons to expand/collapse all sub-folders were not showing up (temporary fix without using [@vscode/codicons](https://github.com/microsoft/vscode-codicons))
6+
37
## [0.4.0] - 2022-07-30
48
### Added
59
- Buttons to expand/collapse all sub-folders in the gallery view

media/gallery.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,15 @@ html {
129129

130130
.codicon {
131131
padding: 3px;
132+
width: 20px;
133+
height: 20px;
132134
background-color: hsl(0, 0%, 17%);
133-
border: 0;
135+
border-color: white;
136+
border-width: 1px;
134137
color: white;
135138
}
136139

137140
.codicon:hover {
138141
background-color: hsl(180, 0%, 21%);
139-
border-radius: 5px;
142+
border-radius: 3px;
140143
}

media/gallery.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,37 @@
4747

4848
let expandAll = Array.from(gridElements).some(el => el.style.display === "none");
4949
if (expandAll) {
50-
let collapseAllButton = document.getElementsByClassName("codicon-collapse-all");
50+
let collapseAllButton = document.getElementsByClassName("temp-collapse-all");
5151
if (collapseAllButton.length !== 0) {
52-
collapseAllButton[0].setAttribute("class", "codicon codicon-expand-all");
52+
collapseAllButton[0].setAttribute("class", "codicon temp-expand-all");
53+
collapseAllButton[0].textContent = "+";
5354
}
5455
} else {
55-
let expandAllButton = document.getElementsByClassName("codicon-expand-all");
56+
let expandAllButton = document.getElementsByClassName("temp-expand-all");
5657
if (expandAllButton.length !== 0) {
57-
expandAllButton[0].setAttribute("class", "codicon codicon-collapse-all");
58+
expandAllButton[0].setAttribute("class", "codicon temp-collapse-all");
59+
collapseAllButton[0].textContent = "−";
5860
}
5961
}
6062
return;
6163
}
6264

63-
if (node.classList.contains("codicon-expand-all")) {
65+
if (node.classList.contains("temp-expand-all")) {
6466
gridElements.forEach((gridElement) => {
6567
gridElement.style.display = "grid";
6668
gridElement.previousElementSibling.firstElementChild.textContent = "⮟";
6769
});
68-
node.setAttribute("class", "codicon codicon-collapse-all");
70+
node.setAttribute("class", "codicon temp-collapse-all");
71+
node.textContent = "−";
6972
return;
7073
}
71-
if (node.classList.contains("codicon-collapse-all")) {
74+
if (node.classList.contains("temp-collapse-all")) {
7275
gridElements.forEach((gridElement) => {
7376
gridElement.style.display = "none";
7477
gridElement.previousElementSibling.firstElementChild.textContent = "⮞";
7578
});
76-
node.setAttribute("class", "codicon codicon-expand-all");
79+
node.setAttribute("class", "codicon temp-expand-all");
80+
node.textContent = "+";
7781
return;
7882
}
7983

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-image-gallery",
33
"displayName": "Image Gallery",
44
"description": "An extension that enhances image browsing experience.",
5-
"version": "0.4.0",
5+
"version": "0.4.1",
66
"publisher": "GeriYoco",
77
"repository": {
88
"type": "git",

src/gallery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ function getWebviewContent(
108108
<body>
109109
<div class="toolbar">
110110
${Object.keys(imagesBySubFolders).length > 1 ?
111-
'<button class="codicon codicon-expand-all"></button>' :
112-
'<button class="codicon codicon-collapse-all"></button>'
111+
'<button class="codicon temp-expand-all">+</button>' :
112+
'<button class="codicon temp-collapse-all">-</button>'
113113
}
114114
<div class="folder-count">${Object.keys(imagesBySubFolders).length} folders found</div>
115115
</div>

0 commit comments

Comments
 (0)