add some comments on how to use notifications

This commit is contained in:
Johannes Zellner
2016-01-14 15:56:23 +01:00
parent 658305c969
commit a92d4f2af7
2 changed files with 13 additions and 2 deletions

View File

@@ -102,12 +102,21 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
Notification.error({ title: 'Cloudron Error', message: message });
};
/*
Example usage with an action:
var actionScope = $scope.$new(true);
actionScope.action = '/#/certs';
Client.notify('title', 'message', true, actionScope);
*/
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;
}

View File

@@ -879,7 +879,9 @@ $graphs-success-alt: lighten(#27CE65, 20%);
}
}
// ----------------------------
// Notification
// ----------------------------
.ui-notification {
cursor: auto;