Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-12 21:54:20 +0400
committerVincent Petry <pvince81@owncloud.com>2014-05-15 19:51:04 +0400
commit6fd084243b65a556d4775209ba3916145ef5912a (patch)
tree6162c2af1861d8e3b8bbf1340ac55c4affc5ad61 /apps/files/js/app.js
parent9d38e3602b2faf37d861729c52690ce51b8fee97 (diff)
Fixed many issues, clean up
- fixed upload and storage statistics - fixed infinite scroll to use the correct contain for scroll detection - fixed unit test that sometimes fail for rename case - controls are now sticky again - fixed selection overlay to be aligned with the table - fixed "select all" checkbox that had id conflicts - fixed public page - fixed global actions permissions detection - fix when URL contains an invalid view id - viewer mode now hides the sidebar (ex: text editor) - added unit tests for trashbin - clean up storage info in template (most is retrieved via ajax call now)
Diffstat (limited to 'apps/files/js/app.js')
-rw-r--r--apps/files/js/app.js26
1 files changed, 23 insertions, 3 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js
index 6cdb339b22d..9155fb38cdb 100644
--- a/apps/files/js/app.js
+++ b/apps/files/js/app.js
@@ -11,6 +11,7 @@
*
*/
+/* global dragOptions, folderDropOptions */
(function() {
if (!OCA.Files) {
@@ -24,11 +25,16 @@
this.navigation = new OCA.Files.Navigation($('#app-navigation'));
// TODO: ideally these should be in a separate class / app (the embedded "all files" app)
- this.fileList = OCA.Files.FileList;
this.fileActions = OCA.Files.FileActions;
this.files = OCA.Files.Files;
- this.fileList = new OCA.Files.FileList($('#app-content-files'));
+ this.fileList = new OCA.Files.FileList(
+ $('#app-content-files'), {
+ scrollContainer: $('#app-content'),
+ dragOptions: dragOptions,
+ folderDropOptions: folderDropOptions
+ }
+ );
this.files.initialize();
this.fileActions.registerDefaultActions(this.fileList);
this.fileList.setFileActions(this.fileActions);
@@ -58,7 +64,8 @@
OC.Util.History.addOnPopStateHandler(_.bind(this._onPopState, this));
// detect when app changed their current directory
- $('#app-content>div').on('changeDirectory', _.bind(this._onDirectoryChanged, this));
+ $('#app-content').delegate('>div', 'changeDirectory', _.bind(this._onDirectoryChanged, this));
+ $('#app-content').delegate('>div', 'changeViewerMode', _.bind(this._onChangeViewerMode, this));
$('#app-navigation').on('itemChanged', _.bind(this._onNavigationChanged, this));
},
@@ -88,6 +95,16 @@
},
/**
+ * Event handler for when an app notifies that it needs space
+ * for viewer mode.
+ */
+ _onChangeViewerMode: function(e) {
+ var state = !!e.viewerModeEnabled;
+ $('#app-navigation').toggleClass('hidden', state);
+ $('.app-files').toggleClass('viewer-mode no-sidebar', state);
+ },
+
+ /**
* Event handler for when the URL changed
*/
_onPopState: function(params) {
@@ -96,6 +113,9 @@
view: 'files'
}, params);
var lastId = this.navigation.getActiveItem();
+ if (!this.navigation.itemExists(params.view)) {
+ params.view = 'files';
+ }
this.navigation.setActiveItem(params.view, {silent: true});
if (lastId !== this.navigation.getActiveItem()) {
this.navigation.getActiveContainer().trigger(new $.Event('show'));