update
This commit is contained in:
9
main.js
9
main.js
@@ -2016,6 +2016,7 @@ var GridView = class extends import_obsidian7.ItemView {
|
|||||||
this.plugin.settings.titleFontSize + "em"
|
this.plugin.settings.titleFontSize + "em"
|
||||||
);
|
);
|
||||||
this.gridItems = [];
|
this.gridItems = [];
|
||||||
|
const gridInner = container.createDiv("ge-grid-inner");
|
||||||
if (
|
if (
|
||||||
this.sourceMode === "bookmarks" &&
|
this.sourceMode === "bookmarks" &&
|
||||||
!((_a = this.app.internalPlugins.plugins.bookmarks) == null
|
!((_a = this.app.internalPlugins.plugins.bookmarks) == null
|
||||||
@@ -2038,7 +2039,7 @@ var GridView = class extends import_obsidian7.ItemView {
|
|||||||
this.plugin.settings.showParentFolderItem &&
|
this.plugin.settings.showParentFolderItem &&
|
||||||
this.sourcePath !== "/"
|
this.sourcePath !== "/"
|
||||||
) {
|
) {
|
||||||
const parentFolderEl = container.createDiv("ge-grid-item ge-folder-item");
|
const parentFolderEl = gridInner.createDiv("ge-grid-item ge-folder-item");
|
||||||
this.gridItems.push(parentFolderEl);
|
this.gridItems.push(parentFolderEl);
|
||||||
const parentPath =
|
const parentPath =
|
||||||
this.sourcePath.split("/").slice(0, -1).join("/") || "/";
|
this.sourcePath.split("/").slice(0, -1).join("/") || "/";
|
||||||
@@ -2208,7 +2209,7 @@ var GridView = class extends import_obsidian7.ItemView {
|
|||||||
})
|
})
|
||||||
.sort((a, b) => a.name.localeCompare(b.name));
|
.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
for (const folder of subfolders) {
|
for (const folder of subfolders) {
|
||||||
const folderEl = container.createDiv("ge-grid-item ge-folder-item");
|
const folderEl = gridInner.createDiv("ge-grid-item ge-folder-item");
|
||||||
this.gridItems.push(folderEl);
|
this.gridItems.push(folderEl);
|
||||||
folderEl.dataset.folderPath = folder.path;
|
folderEl.dataset.folderPath = folder.path;
|
||||||
if (import_obsidian7.Platform.isDesktop) {
|
if (import_obsidian7.Platform.isDesktop) {
|
||||||
@@ -2376,7 +2377,7 @@ var GridView = class extends import_obsidian7.ItemView {
|
|||||||
}
|
}
|
||||||
let files = [];
|
let files = [];
|
||||||
if (this.searchQuery && this.sourceMode !== "random-note") {
|
if (this.searchQuery && this.sourceMode !== "random-note") {
|
||||||
const loadingDiv = container.createDiv("ge-loading-indicator");
|
const loadingDiv = gridInner.createDiv("ge-loading-indicator");
|
||||||
loadingDiv.setText(t("searching"));
|
loadingDiv.setText(t("searching"));
|
||||||
let allFiles = [];
|
let allFiles = [];
|
||||||
if (this.searchAllFiles) {
|
if (this.searchAllFiles) {
|
||||||
@@ -2519,7 +2520,7 @@ var GridView = class extends import_obsidian7.ItemView {
|
|||||||
let filesCardEl = null;
|
let filesCardEl = null;
|
||||||
let filesListEl = null;
|
let filesListEl = null;
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
filesCardEl = container.createDiv("ge-grid-item ge-files-card");
|
filesCardEl = gridInner.createDiv("ge-grid-item ge-files-card");
|
||||||
filesListEl = filesCardEl.createDiv("ge-folder-files");
|
filesListEl = filesCardEl.createDiv("ge-folder-files");
|
||||||
}
|
}
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
|
|||||||
39
styles.css
39
styles.css
@@ -19,10 +19,7 @@
|
|||||||
/* Grid 樣式 */
|
/* Grid 樣式 */
|
||||||
.ge-grid-container {
|
.ge-grid-container {
|
||||||
display: block;
|
display: block;
|
||||||
column-count: 1;
|
padding: 0 !important;
|
||||||
column-width: 320px;
|
|
||||||
column-gap: 12px;
|
|
||||||
padding: 12px !important;
|
|
||||||
background: var(--background-secondary) !important;
|
background: var(--background-secondary) !important;
|
||||||
flex: 1 1 0;
|
flex: 1 1 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -31,6 +28,40 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
container-type: inline-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ge-grid-inner {
|
||||||
|
display: block;
|
||||||
|
column-width: 320px;
|
||||||
|
column-gap: 12px;
|
||||||
|
padding: 12px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@container (max-width: 340px) {
|
||||||
|
.ge-grid-inner {
|
||||||
|
column-count: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@container (min-width: 340px) and (max-width: 660px) {
|
||||||
|
.ge-grid-inner {
|
||||||
|
column-count: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@container (min-width: 660px) and (max-width: 990px) {
|
||||||
|
.ge-grid-inner {
|
||||||
|
column-count: 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@container (min-width: 990px) and (max-width: 1320px) {
|
||||||
|
.ge-grid-inner {
|
||||||
|
column-count: 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-mobile .ge-grid-container::-webkit-scrollbar {
|
.is-mobile .ge-grid-container::-webkit-scrollbar {
|
||||||
|
|||||||
Reference in New Issue
Block a user