aboutsummaryrefslogtreecommitdiff
path: root/vfs/vfs.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vfs/vfs.ts')
-rw-r--r--vfs/vfs.ts21
1 files changed, 14 insertions, 7 deletions
diff --git a/vfs/vfs.ts b/vfs/vfs.ts
index d249376..7ab5bdb 100644
--- a/vfs/vfs.ts
+++ b/vfs/vfs.ts
@@ -37,7 +37,7 @@ export class Vfs {
constructor(public opts: VfsOptions) {
this.el = document.getElementById(opts.id)
if (!this.el) {
- console.log("Vfs: element id", opts.id, "not found")
+ console.error("Vfs: element id", opts.id, "not found")
return
}
}
@@ -85,7 +85,7 @@ export class Vfs {
onClickPath(this: Vfs, path: string) {
const node = this.pathNode[path]
if (!node) {
- console.log("Vfs: onClickPath: invalid path: ", path)
+ console.error("Vfs: onClickPath: invalid path: ", path)
return
}
this.open(node)
@@ -164,7 +164,7 @@ class VfsList {
this.el = document.createElement("div")
this.el.style.borderWidth = "1px"
this.el.style.borderStyle = "solid"
- this.el.style.borderColor = "black"
+ this.el.style.borderColor = "silver"
}
open(node: VfsNode) {
@@ -189,7 +189,7 @@ class VfsPath {
this.el = document.createElement("div")
this.el.style.borderWidth = "1px"
this.el.style.borderStyle = "solid"
- this.el.style.borderColor = "black"
+ this.el.style.borderColor = "silver"
this.crumbs = []
this.onClick = onClick
}
@@ -205,9 +205,16 @@ class VfsPath {
paths = node.path.split("/")
}
- for (let p of paths) {
- if (p == "") {
+ for (let x = 0; x < paths.length; x++) {
+ let fullPath = ""
+ let p = ""
+
+ if (x == 0) {
p = "/"
+ fullPath = "/"
+ } else {
+ p = paths[x]
+ fullPath = paths.slice(0, x + 1).join("/")
}
let crumb = document.createElement("span")
@@ -217,7 +224,7 @@ class VfsPath {
crumb.innerHTML = p
crumb.onclick = (event) => {
- this.onClick(p)
+ this.onClick(fullPath)
}
crumb.onmouseout = (event) => {
this.onMouseOut(crumb, event)