added success notification when new series is added.

This commit is contained in:
Keivan Beigi 2013-01-28 19:01:46 -08:00 committed by kay.one
parent 159585553c
commit 30a049e4fb
5 changed files with 18 additions and 8 deletions

View File

@ -50,7 +50,7 @@
</div>
<div id="content" class="row">
<div class="span20">
<div id="error-region" class="row">
<div id="notification-region" class="row">
</div>
<div id="sub-menu-region" class="row">
</div>

View File

@ -38,7 +38,17 @@ NzbDrone.AddSeries.SearchItemView = Backbone.Marionette.ItemView.extend({
path: path
});
model.save();
model.save(undefined, {
success: function () {
var notificationModel = new NzbDrone.Shared.NotificationModel({
title: 'Added',
message: title,
level: 'success'
});
NzbDrone.Shared.NotificationCollectionView.Instance.collection.add(notificationModel);
}
});
}
@ -53,7 +63,7 @@ NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend(
initialize: function () {
this.listenTo(this.collection, 'reset', this.render);
},
});

View File

@ -60,10 +60,10 @@ body {
}
#error-region .alert {
#notification-region .alert {
margin: 10px;
}
#error-region .alert .icon-warning-sign {
#notification-region i {
padding-right: 10px;
}

View File

@ -32,7 +32,7 @@ NzbDrone.Shared.NotificationCollectionView = Backbone.Marionette.CollectionView.
});
NzbDrone.addInitializer(function (options) {
NzbDrone.errorRegion.show(NzbDrone.Shared.NotificationCollectionView.Instance);
NzbDrone.notificationRegion.show(NzbDrone.Shared.NotificationCollectionView.Instance);
});

View File

@ -74,7 +74,7 @@ NzbDrone.addInitializer(function (options) {
NzbDrone.addRegions({
mainRegion: "#main-region",
errorRegion: "#error-region"
notificationRegion: "#notification-region"
});
NzbDrone.Router = new NzbDrone.Router();