1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Messenger supports hideOnNavigate now

New: After adding a series you will be able to navigate to it via the UI notification
This commit is contained in:
Mark McDowall 2014-04-04 10:58:21 -07:00
parent 0f9360bccb
commit b65f2e7845
2 changed files with 29 additions and 4 deletions

View File

@ -1,9 +1,10 @@
'use strict';
define(
[
'underscore',
'vent',
'AppLayout',
'underscore',
'backbone',
'marionette',
'Quality/QualityProfileCollection',
'AddSeries/RootFolders/RootFolderCollection',
@ -13,7 +14,18 @@ define(
'Shared/Messenger',
'Mixins/AsValidatedView',
'jquery.dotdotdot'
], function (vent, AppLayout, _, Marionette, QualityProfiles, RootFolders, RootFolderLayout, SeriesCollection, Config, Messenger, AsValidatedView) {
], function (_,
vent,
AppLayout,
Backbone,
Marionette,
QualityProfiles,
RootFolders,
RootFolderLayout,
SeriesCollection,
Config,
Messenger,
AsValidatedView) {
var view = Marionette.ItemView.extend({
@ -156,7 +168,17 @@ define(
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
Messenger.show({
message: 'Added: ' + self.model.get('title')
message: 'Added: ' + self.model.get('title'),
actions : {
goToSeries: {
label: 'Go to Series Page',
action: function() {
Backbone.history.navigate('/series/' + self.model.get('titleSlug'), { trigger: true });
}
}
},
hideAfter: 8,
hideOnNavigate: true
});
vent.trigger(vent.Events.SeriesAdded, { series: self.model });

View File

@ -23,13 +23,16 @@ define(function () {
}
}
options.hideOnNavigate = options.hideOnNavigate || false;
return window.Messenger().post({
message : options.message,
type : options.type,
showCloseButton: true,
hideAfter : options.hideAfter,
id : options.id,
actions : options.actions
actions : options.actions,
hideOnNavigate : options.hideOnNavigate
});
},