diff options
Diffstat (limited to 'frontend/js')
-rw-r--r-- | frontend/js/app.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/frontend/js/app.js b/frontend/js/app.js index befed24..bf9b534 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js | |||
@@ -135,6 +135,12 @@ function open(entry) { | |||
135 | window.open(encode(path)); | 135 | window.open(encode(path)); |
136 | } | 136 | } |
137 | 137 | ||
138 | function download(entry) { | ||
139 | if (entry.isDirectory) return; | ||
140 | |||
141 | window.open(encode('/api/files/' + sanitize(app.path + '/' + entry.filePath)) + '?access_token=' + localStorage.accessToken); | ||
142 | } | ||
143 | |||
138 | function up() { | 144 | function up() { |
139 | window.location.hash = sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/')); | 145 | window.location.hash = sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/')); |
140 | } | 146 | } |
@@ -329,6 +335,7 @@ var app = new Vue({ | |||
329 | logout: logout, | 335 | logout: logout, |
330 | loadDirectory: loadDirectory, | 336 | loadDirectory: loadDirectory, |
331 | open: open, | 337 | open: open, |
338 | download: download, | ||
332 | up: up, | 339 | up: up, |
333 | upload: upload, | 340 | upload: upload, |
334 | delAsk: delAsk, | 341 | delAsk: delAsk, |