aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/js/app.js
diff options
context:
space:
mode:
authorJohannes <johannes@cloudron.io>2016-11-06 15:37:30 +0100
committerJohannes <johannes@cloudron.io>2016-11-06 15:37:36 +0100
commit51723cdf2904a4341591c163cb119a80b0c26542 (patch)
tree57be0c81a31a15d1b3567a104b3ee634abe6417a /app/js/app.js
parent5f43935e567855125be9ffae1108cb6212cb8d93 (diff)
downloadSurfer-51723cdf2904a4341591c163cb119a80b0c26542.tar.gz
Surfer-51723cdf2904a4341591c163cb119a80b0c26542.tar.zst
Surfer-51723cdf2904a4341591c163cb119a80b0c26542.zip
Make breadcrumbs clickable
Fixes #2
Diffstat (limited to 'app/js/app.js')
-rw-r--r--app/js/app.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/js/app.js b/app/js/app.js
index b26a2a6..739e9b1 100644
--- a/app/js/app.js
+++ b/app/js/app.js
@@ -77,9 +77,7 @@ function loadDirectory(filePath) {
77 77
78 filePath = filePath ? sanitize(filePath) : '/'; 78 filePath = filePath ? sanitize(filePath) : '/';
79 79
80 console.log(filePath); 80 superagent.get('/api/files/' + encode(filePath)).query({ username: app.session.username, password: app.session.password }).end(function (error, result) {
81
82 superagent.get('/api/files/' + filePath).query({ username: app.session.username, password: app.session.password }).end(function (error, result) {
83 app.busy = false; 81 app.busy = false;
84 82
85 if (result && result.statusCode === 401) return logout(); 83 if (result && result.statusCode === 401) return logout();
@@ -91,7 +89,12 @@ function loadDirectory(filePath) {
91 return entry; 89 return entry;
92 }); 90 });
93 app.path = filePath; 91 app.path = filePath;
94 app.pathParts = decode(filePath).split('/').filter(function (e) { return !!e; }); 92 app.pathParts = decode(filePath).split('/').filter(function (e) { return !!e; }).map(function (e, i, a) {
93 return {
94 name: e,
95 link: '#' + sanitize('/' + a.slice(0, i).join('/') + '/' + e)
96 };
97 });
95 98
96 // update in case this was triggered from code 99 // update in case this was triggered from code
97 window.location.hash = app.path; 100 window.location.hash = app.path;