summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorfnuesse <fnuesse@techfak.uni-bielefeld.de>2018-06-01 20:29:43 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-12 16:49:37 +0200
commit72ace9697c0951b3379a88c3cb639e1c9abe0170 (patch)
tree7d24e3efbc36020579d99f4556f2bbed1cffd218 /apps/files/js
parent09d5b61c9e468cdc0b92db27946140e68192e2e5 (diff)
downloadnextcloud-server-72ace9697c0951b3379a88c3cb639e1c9abe0170.tar.gz
nextcloud-server-72ace9697c0951b3379a88c3cb639e1c9abe0170.zip
Added FavoritesQuickaccess-Sidebar
Added FavoritesQuickaccess-Sidebar Added Files-FavoritesQuickaccess-Toggle Fixed CSS for SpacerElement Removed Unnessessary Alerts and added Translations Tried fixing initial Quick-Access Checkboxstate Signed-off-by: fnuesse <fnuesse@techfak.uni-bielefeld.de> Tried fixing initial Quick-Access Checkboxstate Changed double-Quotes to single-Quotes Revert webdavurl which was changed by mistake Revert quota-icon which was changed by mistake Changed the Folderhandling from custom-designed to nextcloud-NavigationManager-handling Signed-off-by: fnuesse <fnuesse@techfak.uni-bielefeld.de> Moved CSS-Spacerclass to apps.scss for global usage Signed-off-by: fnuesse <felix.nuesse@t-online.de> Renamed settings-caption in apps.scss to app-navigation-caption Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed old input-tag for showQuickAccess-state Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed old spacer element in files.scss Signed-off-by: fnuesse <felix.nuesse@t-online.de> Changed style of favorites-sublist and disabled the ability to disable files-quickaccess Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/app.js40
1 files changed, 39 insertions, 1 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js
index 6a21bce975b..97b8b630f72 100644
--- a/apps/files/js/app.js
+++ b/apps/files/js/app.js
@@ -53,12 +53,19 @@
this.$showHiddenFiles = $('input#showhiddenfilesToggle');
var showHidden = $('#showHiddenFiles').val() === "1";
this.$showHiddenFiles.prop('checked', showHidden);
+
+ this.$showQuickAccess = $('input#showfavoritequickaccessToggle');
+ var showQuickAccess = $('#showFavoriteQuickAccess').val() === "1";
+ this.$showQuickAccess.prop('checked', showQuickAccess);
+
+
if ($('#fileNotFound').val() === "1") {
OC.Notification.show(t('files', 'File could not be found'), {type: 'error'});
}
this._filesConfig = new OC.Backbone.Model({
- showhidden: showHidden
+ showhidden: showHidden,
+ showQuickAccess: showQuickAccess
});
var urlParams = OC.Util.History.parseUrlQuery();
@@ -131,6 +138,7 @@
});
this._debouncedPersistShowHiddenFilesState = _.debounce(this._persistShowHiddenFilesState, 1200);
+ this._debouncedPersistShowQuickAccessState = _.debounce(this._persistShowQuickAccessState, 1200);
},
/**
@@ -205,6 +213,7 @@
$('#app-navigation').on('itemChanged', _.bind(this._onNavigationChanged, this));
this.$showHiddenFiles.on('change', _.bind(this._onShowHiddenFilesChange, this));
+ this.$showQuickAccess.on('change', _.bind(this._onShowQuickAccessChange, this));
},
/**
@@ -230,6 +239,35 @@
});
},
+
+ /**
+ * Toggle showing hidden files according to the settings checkbox
+ *
+ * @returns {undefined}
+ */
+ _onShowQuickAccessChange: function() {
+ var qa = this.$showQuickAccess.is(':checked');
+ this._filesConfig.set('show_quick_access', qa);
+ this._debouncedPersistShowQuickAccessState();
+ },
+
+ /**
+ * Persist show hidden preference on ther server
+ *
+ * @returns {undefined}
+ */
+ _persistShowQuickAccessState: function() {
+ var qa = this._filesConfig.get('show_quick_access');
+ var url="/apps/files/api/v1/hidequickaccess";
+ if(qa){
+ url="/apps/files/api/v1/showquickaccess";
+ }
+
+ $.get(OC.generateUrl(url),function(data, status){
+ });
+ },
+
+
/**
* Event handler for when the current navigation item has changed
*/