Skip to content

Commit

Permalink
Highlight files after setFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
felixheidecke committed Aug 14, 2017
1 parent 3b0f072 commit 5350777
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@
*/
_filter: '',

/**
* File to be highlighted in view
* @type String
*/
_scrollTo: null,

/**
* @type Backbone.Model
*/
Expand Down Expand Up @@ -209,7 +215,9 @@
if (this.initialized) {
return;
}

if (options.scrollTo) {
this._scrollTo = options.scrollTo;
}
if (options.config) {
this._filesConfig = options.config;
} else if (!_.isUndefined(OCA.Files) && !_.isUndefined(OCA.Files.App)) {
Expand Down Expand Up @@ -332,12 +340,6 @@

this.$container.on('scroll', _.bind(this._onScroll, this));

if (options.scrollTo) {
this.$fileList.one('updated', function() {
self.scrollTo(options.scrollTo);
});
}

if (options.enableUpload) {
// TODO: auto-create this element
var $uploadEl = this.$el.find('#file_upload_start');
Expand Down Expand Up @@ -1033,6 +1035,13 @@
_.defer(function() {
self.$el.closest('#app-content').trigger(jQuery.Event('apprendered'));
});

if (this._scrollTo) {
this.$fileList.on('updated', function() {
self.scrollTo(self._scrollTo);
self._scrollTo = null;
});
}
},

/**
Expand Down

0 comments on commit 5350777

Please sign in to comment.