aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/js/app.js')
-rw-r--r--frontend/js/app.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/frontend/js/app.js b/frontend/js/app.js
index 57b831e..e9d469b 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -211,7 +211,9 @@ var app = new Vue({
211 }, 211 },
212 onOptionsMenu: function (command) { 212 onOptionsMenu: function (command) {
213 if (command === 'folderListing') { 213 if (command === 'folderListing') {
214 console.log('Not implemented'); 214 superagent.put('/api/settings').send({ folderListingEnabled: this.folderListingEnabled }).query({ access_token: localStorage.accessToken }).end(function (error) {
215 if (error) console.error(error);
216 });
215 } else if (command === 'about') { 217 } else if (command === 'about') {
216 this.$msgbox({ 218 this.$msgbox({
217 title: 'About Surfer', 219 title: 'About Surfer',
@@ -337,6 +339,12 @@ getProfile(localStorage.accessToken, function (error) {
337 if (error) return console.error(error); 339 if (error) return console.error(error);
338 340
339 loadDirectory(window.location.hash.slice(1)); 341 loadDirectory(window.location.hash.slice(1));
342
343 superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) {
344 if (error) console.error(error);
345
346 app.folderListingEnabled = !!result.body.folderListingEnabled;
347 });
340}); 348});
341 349
342$(window).on('hashchange', function () { 350$(window).on('hashchange', function () {