From 3e3e4899fa2ae5a35ea4db9e526c49b93d02d613 Mon Sep 17 00:00:00 2001 From: Bernd Stellwag Date: Wed, 18 Oct 2017 19:51:40 +0200 Subject: [PATCH 1/2] bugfix: set/change page title when switching to filelist Signed-off-by: Bernd Stellwag --- apps/files/js/filelist.js | 1 + apps/files/tests/js/filelistSpec.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index cc23ac7397..395490d355 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1673,6 +1673,7 @@ // close sidebar this._updateDetailsView(null); } + this._setCurrentDir(this.getCurrentDirectory(), false); var callBack = this.reloadCallback.bind(this); return this._reloadCall.then(callBack, callBack); }, diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 836a5e5ce7..8154ffaa7c 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -1621,7 +1621,9 @@ describe('OCA.Files.FileList tests', function() { var setDirSpy = sinon.spy(fileList.breadcrumb, 'setDirectory'); fileList.changeDirectory('/anothersubdir'); deferredList.resolve(200, [testRoot].concat(testFiles)); - expect(fileList.breadcrumb.setDirectory.calledOnce).toEqual(true); + // twice because setDirectory gets called by _setCurrentDir which + // gets called directly by changeDirectory and via reload() + expect(fileList.breadcrumb.setDirectory.calledTwice).toEqual(true); expect(fileList.breadcrumb.setDirectory.calledWith('/anothersubdir')).toEqual(true); setDirSpy.restore(); getFolderContentsStub.restore(); From 844db3c891c10d575728742eef69945c807c9472 Mon Sep 17 00:00:00 2001 From: Bernd Stellwag Date: Wed, 18 Oct 2017 19:55:30 +0200 Subject: [PATCH 2/2] bugfix: set/change page title when switching to file tags Signed-off-by: Bernd Stellwag --- apps/systemtags/js/systemtagsfilelist.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/systemtags/js/systemtagsfilelist.js b/apps/systemtags/js/systemtagsfilelist.js index a40eb548d9..ad6bf7dd78 100644 --- a/apps/systemtags/js/systemtagsfilelist.js +++ b/apps/systemtags/js/systemtagsfilelist.js @@ -234,6 +234,9 @@ }, reload: function() { + // there is only root + this._setCurrentDir('/', false); + if (!this._systemTagIds.length) { // don't reload this.updateEmptyContent();