X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=frontend%2Fjs%2Fapp.js;h=e9d469be99d400656e7107259265c8f2503ece1d;hb=552d44bbd28eb66c05b450f112ce20bff463fe6f;hp=57b831eeca698423a3e25bafcde72900fdf0d87c;hpb=f2f2b69322749c558f2dac8bf21b1620aacc284b;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git 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({ }, onOptionsMenu: function (command) { if (command === 'folderListing') { - console.log('Not implemented'); + superagent.put('/api/settings').send({ folderListingEnabled: this.folderListingEnabled }).query({ access_token: localStorage.accessToken }).end(function (error) { + if (error) console.error(error); + }); } else if (command === 'about') { this.$msgbox({ title: 'About Surfer', @@ -337,6 +339,12 @@ getProfile(localStorage.accessToken, function (error) { if (error) return console.error(error); loadDirectory(window.location.hash.slice(1)); + + superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) { + if (error) console.error(error); + + app.folderListingEnabled = !!result.body.folderListingEnabled; + }); }); $(window).on('hashchange', function () {