From 8af3348e7fc7c17341264aa974300cd60ae12b74 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 15 Feb 2017 19:38:05 -0800 Subject: [PATCH] Fixed: Slow loading root folders caused them to never appear --- src/UI/AddSeries/RootFolders/RootFolderLayout.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/UI/AddSeries/RootFolders/RootFolderLayout.js b/src/UI/AddSeries/RootFolders/RootFolderLayout.js index 6dae383d7..d96b01a7b 100644 --- a/src/UI/AddSeries/RootFolders/RootFolderLayout.js +++ b/src/UI/AddSeries/RootFolders/RootFolderLayout.js @@ -24,9 +24,7 @@ var Layout = Marionette.Layout.extend({ initialize : function() { this.collection = RootFolderCollection; - this.rootfolderListView = new RootFolderCollectionView({ collection : RootFolderCollection }); - - this.listenTo(this.rootfolderListView, 'itemview:folderSelected', this._onFolderSelected); + this.rootfolderListView = null; }, onShow : function() { @@ -60,7 +58,12 @@ var Layout = Marionette.Layout.extend({ }, _showCurrentDirs : function() { - this.currentDirs.show(this.rootfolderListView); + if (!this.rootfolderListView) { + this.rootfolderListView = new RootFolderCollectionView({ collection : RootFolderCollection }); + this.currentDirs.show(this.rootfolderListView); + + this.listenTo(this.rootfolderListView, 'itemview:folderSelected', this._onFolderSelected); + } }, _keydown : function(e) { @@ -74,4 +77,4 @@ var Layout = Marionette.Layout.extend({ var Layout = AsValidatedView.apply(Layout); -module.exports = Layout; \ No newline at end of file +module.exports = Layout;