Comparing version 1.0.1 to 1.0.2
15
index.js
@@ -11,3 +11,2 @@ var relative = require('relative-date') | ||
var fresh = Tree(widget, root, entries, onclick) | ||
console.log(widget, fresh) | ||
if (widget) yo.update(widget, fresh) | ||
@@ -41,5 +40,9 @@ return fresh | ||
function backButton () { | ||
console.log('clicked') | ||
render(widget, path.dirname(root), entries, onclick) | ||
function backButton (ev) { | ||
var entry = { | ||
name: path.dirname(root), | ||
type: 'directory' | ||
} | ||
onclick(ev, entry) | ||
render(widget, entry.name, entries, onclick) | ||
} | ||
@@ -58,2 +61,3 @@ function backRow () { | ||
function click (e) { | ||
onclick(e, entry) | ||
if (entry.type === 'directory') { | ||
@@ -68,5 +72,4 @@ render(widget, entry.name, entries, onclick) | ||
} | ||
onclick(e, entry) | ||
} | ||
return yo`<li class='entry-${entry.type}' onclick=${click}> | ||
return yo`<li class='entry ${entry.type}' onclick=${click}> | ||
<a href="javascript:void(0)"> | ||
@@ -73,0 +76,0 @@ <span class="name">${path.basename(entry.name)}</span> |
{ | ||
"name": "yo-fs", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "a filesystem browser built with yo", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3230
81