mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
added command support to toolbar.
This commit is contained in:
27
UI/Shared/Messenger.js
Normal file
27
UI/Shared/Messenger.js
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
define(['app'], function () {
|
||||
NzbDrone.Shared.Messenger = {
|
||||
show: function (options) {
|
||||
|
||||
if (!options.type) {
|
||||
options.type = 'info';
|
||||
}
|
||||
|
||||
if (!options.hideAfter) {
|
||||
switch (options.type) {
|
||||
case 'info':
|
||||
options.hideAfter = 5;
|
||||
break;
|
||||
case 'error':
|
||||
options.hideAfter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return window.Messenger().post({
|
||||
message : options.message,
|
||||
type : options.type,
|
||||
showCloseButton: true,
|
||||
hideAfter : options.hideAfter
|
||||
});
|
||||
}};
|
||||
});
|
Reference in New Issue
Block a user