Use angular-ui-notification instead of angular-pnotify.

This commit is contained in:
Alexis Lahouze 2016-01-27 21:33:23 +01:00
parent 2fd235bb5f
commit b70b070d5c
4 changed files with 13 additions and 37 deletions

View File

@ -36,8 +36,8 @@ accountantApp
.controller( .controller(
"AccountController", [ "AccountController", [
"$scope", "Account", "notify", "$scope", "Account", "Notification",
function($scope, Account, notify) { function($scope, Account, Notification) {
/* /*
* Return the class for an account current value compared to authorized * Return the class for an account current value compared to authorized
@ -122,11 +122,7 @@ accountantApp
return 0; return 0;
}); });
notify({ Notification.success("Account #" + data.id + " saved.");
message: "Account #" + data.id + " saved.",
classes: "alert-success",
position: "right"
});
return data; return data;
}); });
@ -143,11 +139,7 @@ accountantApp
function(result) { function(result) {
if(result) { if(result) {
account.$delete().then(function() { account.$delete().then(function() {
notify({ Notification.success("Account #" + id + " deleted.");
message: "Account #" + id + " deleted.",
classes: "alert-success",
position: "right"
});
// Remove account from array. // Remove account from array.
$scope.accounts.splice($index, 1); $scope.accounts.splice($index, 1);

View File

@ -19,7 +19,7 @@ var accountantApp = angular.module("accountantApp", [
"mgcrea.ngStrap", "mgcrea.ngStrap",
"highcharts-ng", "highcharts-ng",
"http-auth-interceptor", "http-auth-interceptor",
"cgNotify", 'ui-notification',
"Storage.Service", "Storage.Service",
"xeditable" "xeditable"
]) ])

View File

@ -333,8 +333,8 @@ accountantApp
*/ */
.controller( .controller(
"OperationController", [ "OperationController", [
"$scope", "$rootScope", "$routeParams", "notify", "Account", "Operation", "$scope", "$rootScope", "$routeParams", "Notification", "Account", "Operation",
function($scope, $rootScope, $routeParams, notify, Account, Operation) { function($scope, $rootScope, $routeParams, Notification, Account, Operation) {
// List of operations. // List of operations.
$scope.operations = []; $scope.operations = [];
@ -409,11 +409,7 @@ accountantApp
operation.confirmed = true; operation.confirmed = true;
return operation.$save().then(function(data) { return operation.$save().then(function(data) {
notify({ Notification.success("Operation #" + data.id + " saved.");
message: "Operation #" + data.id + " saved.",
classes: "alert-success",
position: "right"
});
$scope.$emit("operationSavedEvent", data); $scope.$emit("operationSavedEvent", data);
}); });
@ -430,11 +426,7 @@ accountantApp
function(result) { function(result) {
if(result) { if(result) {
operation.$delete().then(function() { operation.$delete().then(function() {
notify({ Notification.success("Operation #" + id + " deleted.");
message: "Operation #" + id + " deleted.",
classes: "alert-success",
position: "right"
});
// Remove operation from array. // Remove operation from array.
$scope.operation.splice($index, 1); $scope.operation.splice($index, 1);

View File

@ -26,8 +26,8 @@ accountantApp
.controller( .controller(
"SchedulerController", [ "SchedulerController", [
"$scope", "$rootScope", "$routeParams", "notify", "ScheduledOperation", "$scope", "$rootScope", "$routeParams", "Notification", "ScheduledOperation",
function($scope, $rootScope, $routeParams, notify, ScheduledOperation) { function($scope, $rootScope, $routeParams, Notification, ScheduledOperation) {
// Operation store. // Operation store.
$scope.operations = []; $scope.operations = [];
@ -66,11 +66,7 @@ accountantApp
} }
return operation.$save().then(function(data) { return operation.$save().then(function(data) {
notify({ Notification.success("Operation #" + data.id + " saved.");
message: "Operation #" + data.id + " saved.",
classes: "alert-success",
position: "right"
});
}); });
}; };
@ -96,11 +92,7 @@ accountantApp
function(result) { function(result) {
if(result) { if(result) {
operation.$delete().then(function() { operation.$delete().then(function() {
notify({ Notification.success("Operation #" + id + " deleted.");
message: "Operation #" + id + " deleted.",
classes: "alert-success",
position: "right"
});
// Remove account from array. // Remove account from array.
$scope.operations.splice($index, 1); $scope.operations.splice($index, 1);