diff --git a/UI/AddSeries/RootFolders/ItemView.js b/UI/AddSeries/RootFolders/ItemView.js index 7963c90b0..8002c9415 100644 --- a/UI/AddSeries/RootFolders/ItemView.js +++ b/UI/AddSeries/RootFolders/ItemView.js @@ -10,6 +10,11 @@ define( template: 'AddSeries/RootFolders/ItemViewTemplate', tagName : 'tr', + initialize: function () { + this.listenTo(this.model, 'change', this.render); + }, + + events: { 'click .x-delete': 'removeFolder', 'click .x-folder': 'folderSelected' diff --git a/UI/AddSeries/RootFolders/ItemViewTemplate.html b/UI/AddSeries/RootFolders/ItemViewTemplate.html index aec633287..cc963b4cf 100644 --- a/UI/AddSeries/RootFolders/ItemViewTemplate.html +++ b/UI/AddSeries/RootFolders/ItemViewTemplate.html @@ -5,6 +5,6 @@ {{Bytes freeSpace}} -
+
diff --git a/UI/AddSeries/RootFolders/Layout.js b/UI/AddSeries/RootFolders/Layout.js index 0e76a39b0..f10788511 100644 --- a/UI/AddSeries/RootFolders/Layout.js +++ b/UI/AddSeries/RootFolders/Layout.js @@ -27,7 +27,8 @@ define( initialize: function () { this.collection = RootFolderCollection; this.rootfolderListView = new RootFolderCollectionView({ collection: RootFolderCollection }); - this.rootfolderListView.on('itemview:folderSelected', this._onFolderSelected, this); + + this.listenTo(this.rootfolderListView, 'itemview:folderSelected', this._onFolderSelected); }, onRender: function () { @@ -41,14 +42,17 @@ define( }, _addFolder: function () { + + var self = this; + var newDir = new RootFolderModel({ Path: this.ui.pathInput.val() }); - RootFolderCollection.create(newDir, { - wait: true, success: function () { - RootFolderCollection.fetch(); - } + RootFolderCollection.add(newDir); + + newDir.save().done(function () { + self.trigger('folderSelected', {model: newDir}); }); } }); diff --git a/UI/AddSeries/RootFolders/LayoutTemplate.html b/UI/AddSeries/RootFolders/LayoutTemplate.html index 93ae996d7..e91145cef 100644 --- a/UI/AddSeries/RootFolders/LayoutTemplate.html +++ b/UI/AddSeries/RootFolders/LayoutTemplate.html @@ -1,13 +1,16 @@