Merge pull request #24157 from owncloud/files-app-is-not-available-on-public-page

OCA.Files.App is not available on public page
This commit is contained in:
Thomas Müller 2016-04-21 23:21:18 +02:00
commit a1da081c62
1 changed files with 9 additions and 6 deletions

View File

@ -147,7 +147,7 @@
/** /**
* @type Backbone.Model * @type Backbone.Model
*/ */
_filesConfig: null, _filesConfig: undefined,
/** /**
* Sort attribute * Sort attribute
@ -205,12 +205,15 @@
if (options.config) { if (options.config) {
this._filesConfig = options.config; this._filesConfig = options.config;
} else { } else if (!_.isUndefined(OCA.Files) && !_.isUndefined(OCA.Files.App)) {
this._filesConfig = OCA.Files.App.getFilesConfig(); this._filesConfig = OCA.Files.App.getFilesConfig();
} }
if (!_.isUndefined(this._filesConfig)) {
this._filesConfig.on('change:showhidden', function() { this._filesConfig.on('change:showhidden', function() {
self.setFiles(self.files); self.setFiles(self.files);
}); });
}
if (options.dragOptions) { if (options.dragOptions) {
this._dragOptions = options.dragOptions; this._dragOptions = options.dragOptions;
@ -984,7 +987,7 @@
* @returns {array} * @returns {array}
*/ */
_filterHiddenFiles: function(files) { _filterHiddenFiles: function(files) {
if (this._filesConfig.get('showhidden')) { if (_.isUndefined(this._filesConfig) || this._filesConfig.get('showhidden')) {
return files; return files;
} }
return _.filter(files, function(file) { return _.filter(files, function(file) {