Support action scopes

This commit is contained in:
Johannes Zellner
2016-01-14 15:54:14 +01:00
parent 263f6e49d8
commit 8aed2be19b

View File

@@ -102,8 +102,16 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
Notification.error({ title: 'Cloudron Error', message: message });
};
Client.prototype.notify = function (title, message, delay) {
Notification.error({ title: title, message: message, delay: delay });
Client.prototype.notify = function (title, message, delay, actionScope) {
var options = { title: title, message: message, delay: delay};
if (actionScope) {
if (typeof actionScope.action !== 'string') throw('an actionScope has to have an action url');
options.scope = actionScope;
}
Notification.error(options);
};
Client.prototype.setReady = function () {