From a40bd0ab710434496f80761aa608614c15b7f66b Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 15 Sep 2017 13:40:12 +0200 Subject: [PATCH] Revert "Highlight files after setFiles" This reverts commit 535077704c6e82728070dba17cf083c952e2d912. --- apps/files/js/filelist.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index defb4f5b6f40..13b07e5e342f 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -145,12 +145,6 @@ */ _filter: '', - /** - * File to be highlighted in view - * @type String - */ - _scrollTo: null, - /** * @type Backbone.Model */ @@ -215,9 +209,7 @@ 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)) { @@ -339,6 +331,12 @@ 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'); @@ -1029,13 +1027,6 @@ _.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; - }); - } }, /**