Use ngBootbox.

This commit is contained in:
Alexis Lahouze 2016-02-08 22:25:47 +01:00
parent 7f4f4b3724
commit 41d8a202fa
5 changed files with 15 additions and 13 deletions

View File

@ -48,8 +48,8 @@ angular.module('accountant')
.controller( .controller(
'AccountController', [ 'AccountController', [
'$scope', 'Account', 'Notification', '$scope', '$ngBootbox', 'Account', 'Notification',
function($scope, Account, Notification) { function($scope, $ngBootbox, Account, Notification) {
/* /*
* Return the class for an account current value compared to authorized * Return the class for an account current value compared to authorized
@ -146,7 +146,7 @@ angular.module('accountant')
$scope.delete = function(account, $index) { $scope.delete = function(account, $index) {
var id = account.id; var id = account.id;
bootbox.confirm( $ngBootbox.confirm(
'Voulez-vous supprimer le compte \\\'' + account.name + '\\\' ?', 'Voulez-vous supprimer le compte \\\'' + account.name + '\\\' ?',
function(result) { function(result) {
if(result) { if(result) {

View File

@ -24,7 +24,8 @@ angular.module('accountant', [
'http-auth-interceptor', 'http-auth-interceptor',
'ui-notification', 'ui-notification',
'Storage.Service', 'Storage.Service',
'xeditable' 'xeditable',
'ngBootbox'
]) ])
.factory('sessionInjector', ['$storage', function($storage) { .factory('sessionInjector', ['$storage', function($storage) {
@ -103,8 +104,8 @@ angular.module('accountant', [
}) })
.controller('MainController', [ .controller('MainController', [
'$scope', '$rootScope', '$http', 'authService', '$storage', '$scope', '$rootScope', '$http', 'authService', '$storage', '$ngBootbox',
function($scope, $rootScope, $http, authService, $storage) { function($scope, $rootScope, $http, authService, $storage, $ngBootbox) {
$scope.dialogShown = false; $scope.dialogShown = false;
$scope.showLoginForm = function() { $scope.showLoginForm = function() {
@ -117,7 +118,7 @@ angular.module('accountant', [
$storage.clear(); $storage.clear();
bootbox.dialog({ $ngBootbox.customDialog({
title: 'Authentification requise', title: 'Authentification requise',
message: '<form class=\'form-horizontal\'>' + message: '<form class=\'form-horizontal\'>' +
' <div class=\'form-group\'>' + ' <div class=\'form-group\'>' +

View File

@ -335,8 +335,8 @@ angular.module('accountant')
*/ */
.controller( .controller(
'OperationController', [ 'OperationController', [
'$scope', '$rootScope', '$routeParams', 'Notification', 'Account', 'Operation', '$scope', '$rootScope', '$routeParams', '$ngBootbox', 'Notification', 'Account', 'Operation',
function($scope, $rootScope, $routeParams, Notification, Account, Operation) { function($scope, $rootScope, $routeParams, $ngBootbox, Notification, Account, Operation) {
// List of operations. // List of operations.
$scope.operations = []; $scope.operations = [];
@ -423,7 +423,7 @@ angular.module('accountant')
$scope.delete = function(operation, $index) { $scope.delete = function(operation, $index) {
var id = operation.id; var id = operation.id;
bootbox.confirm( $ngBootbox.confirm(
'Voulez-vous supprimer l\'opération \\\'' + operation.label + '\\\' ?', 'Voulez-vous supprimer l\'opération \\\'' + operation.label + '\\\' ?',
function(result) { function(result) {
if(result) { if(result) {

View File

@ -29,8 +29,8 @@ angular.module('accountant')
.controller( .controller(
'SchedulerController', [ 'SchedulerController', [
'$scope', '$rootScope', '$routeParams', 'Notification', 'ScheduledOperation', '$scope', '$rootScope', '$routeParams', '$ngBootbox', 'Notification', 'ScheduledOperation',
function($scope, $rootScope, $routeParams, Notification, ScheduledOperation) { function($scope, $rootScope, $routeParams, $ngBootbox, Notification, ScheduledOperation) {
// Operation store. // Operation store.
$scope.operations = []; $scope.operations = [];
@ -90,7 +90,7 @@ angular.module('accountant')
$scope.delete = function(operation, $index) { $scope.delete = function(operation, $index) {
var id = operation.id; var id = operation.id;
bootbox.confirm( $ngBootbox.confirm(
'Voulez-vous supprimer l\'operation planifiée \\\'' + operation.label + '\\\' ?', 'Voulez-vous supprimer l\'operation planifiée \\\'' + operation.label + '\\\' ?',
function(result) { function(result) {
if(result) { if(result) {

View File

@ -75,6 +75,7 @@
<script src="static/bower_components/meanie-angular-storage/release/meanie-angular-storage.js"></script> <script src="static/bower_components/meanie-angular-storage/release/meanie-angular-storage.js"></script>
<script src="static/bower_components/bootbox/bootbox.js"></script> <script src="static/bower_components/bootbox/bootbox.js"></script>
<script src="static/bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script> <script src="static/bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="static/bower_components/ngBootbox/dist/ngBootbox.js"></script>
<!-- endbower --> <!-- endbower -->
<!-- Custom Javascript libraries --> <!-- Custom Javascript libraries -->