Tests and cleanup

This commit is contained in:
Mark McDowall
2013-12-10 18:00:44 -08:00
parent a9ece10144
commit 0a12343b9e
10 changed files with 71 additions and 15 deletions

View File

@@ -94,16 +94,11 @@ define(
model.set('rootFolderPath', rootFolderPath.get('path'));
}
model.trigger('backgrid:select', model, false);
});
this.ui.monitored.val('noChange');
this.ui.qualityProfile.val('noChange');
this.ui.seasonFolder.val('noChange');
this.ui.rootFolder.val('noChange');
SeriesCollection.save();
this.listenTo(SeriesCollection, 'save', this._afterSave);
},
_updateInfo: function () {
@@ -145,6 +140,17 @@ define(
vent.trigger(vent.Commands.CloseModalCommand);
this.ui.rootFolder.val(options.model.id);
this._rootFolderChanged();
},
_afterSave: function () {
this.ui.monitored.val('noChange');
this.ui.qualityProfile.val('noChange');
this.ui.seasonFolder.val('noChange');
this.ui.rootFolder.val('noChange');
SeriesCollection.each(function (model) {
model.trigger('backgrid:select', model, false);
});
}
});
});

View File

@@ -99,11 +99,6 @@ define(
]
},
initialize: function () {
this.listenTo(SeriesCollection, 'sync', this._showTable);
this.listenTo(SeriesCollection, 'remove', this._showTable);
},
onRender: function () {
this._showToolbar();
this._showTable();

View File

@@ -38,6 +38,7 @@ define(
this.listenTo(proxy, 'sync', function (proxyModel, models) {
this.add(models, { merge: true });
this.trigger('save', this);
});
return proxy.save();