From d51517d60cb35247a7dd8e22804e791519de2fe3 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 19 Feb 2014 22:02:11 -0800 Subject: [PATCH] Add existing series shows a loading message Fixed: Message to tell users series are being loaded from trakt --- src/UI/AddSeries/AddSeriesLayoutTemplate.html | 1 + src/UI/AddSeries/AddSeriesView.js | 1 - .../AddExistingSeriesCollectionView.js | 18 ++++++++++++++++-- ...ddExistingSeriesCollectionViewTemplate.html | 5 +++++ src/UI/AddSeries/addSeries.less | 5 +++++ 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 src/UI/AddSeries/Existing/AddExistingSeriesCollectionViewTemplate.html diff --git a/src/UI/AddSeries/AddSeriesLayoutTemplate.html b/src/UI/AddSeries/AddSeriesLayoutTemplate.html index 88dc147aa..b9ccc6c17 100644 --- a/src/UI/AddSeries/AddSeriesLayoutTemplate.html +++ b/src/UI/AddSeries/AddSeriesLayoutTemplate.html @@ -20,3 +20,4 @@
+ diff --git a/src/UI/AddSeries/AddSeriesView.js b/src/UI/AddSeries/AddSeriesView.js index 179cc4a52..951d3431b 100644 --- a/src/UI/AddSeries/AddSeriesView.js +++ b/src/UI/AddSeries/AddSeriesView.js @@ -71,7 +71,6 @@ define( }, onShow: function () { - this.searchResult.show(this.resultCollectionView); this.ui.seriesSearch.focus(); }, diff --git a/src/UI/AddSeries/Existing/AddExistingSeriesCollectionView.js b/src/UI/AddSeries/Existing/AddExistingSeriesCollectionView.js index 45659ffd8..7de5aee81 100644 --- a/src/UI/AddSeries/Existing/AddExistingSeriesCollectionView.js +++ b/src/UI/AddSeries/Existing/AddExistingSeriesCollectionView.js @@ -6,9 +6,15 @@ define( 'AddSeries/Existing/UnmappedFolderCollection' ], function (Marionette, AddSeriesView, UnmappedFolderCollection) { - return Marionette.CollectionView.extend({ + return Marionette.CompositeView.extend({ - itemView: AddSeriesView, + itemView : AddSeriesView, + itemViewContainer: '.x-loading-folders', + template : 'AddSeries/Existing/AddExistingSeriesCollectionViewTemplate', + + ui: { + loadingFolders: '.x-loading-folders' + }, initialize: function () { this.collection = new UnmappedFolderCollection(); @@ -19,6 +25,10 @@ define( this._showAndSearch(0); }, + appendHtml: function(collectionView, itemView, index){ + collectionView.ui.loadingFolders.before(itemView.el); + }, + _showAndSearch: function (index) { var self = this; var model = this.collection.at(index); @@ -35,6 +45,10 @@ define( } }); } + + else { + this.ui.loadingFolders.hide(); + } }, itemViewOptions: { diff --git a/src/UI/AddSeries/Existing/AddExistingSeriesCollectionViewTemplate.html b/src/UI/AddSeries/Existing/AddExistingSeriesCollectionViewTemplate.html new file mode 100644 index 000000000..ca693b1f6 --- /dev/null +++ b/src/UI/AddSeries/Existing/AddExistingSeriesCollectionViewTemplate.html @@ -0,0 +1,5 @@ +
+
+ Loading search results from trakt for your series, this may take a few minutes. +
+
\ No newline at end of file diff --git a/src/UI/AddSeries/addSeries.less b/src/UI/AddSeries/addSeries.less index ee04cb289..42dd309a0 100644 --- a/src/UI/AddSeries/addSeries.less +++ b/src/UI/AddSeries/addSeries.less @@ -104,6 +104,11 @@ width: 140px; } } + + .loading-folders { + margin : 30px 0px; + text-align: center; + } } li.add-new {