mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 13:25:26 +02:00
parent
6f53d1a35a
commit
64ef74321a
7 changed files with 70 additions and 7 deletions
28
app/services/modalService.js
Normal file
28
app/services/modalService.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
angular.module('portainer.services')
|
||||
.factory('ModalService', [function ModalServiceFactory() {
|
||||
'use strict';
|
||||
var service = {};
|
||||
service.confirm = function(options){
|
||||
var box = bootbox.confirm({
|
||||
title: options.title,
|
||||
message: options.message,
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: options.buttons.confirm.label,
|
||||
className: 'btn-danger'
|
||||
},
|
||||
cancel: {
|
||||
label: options.buttons.cancel.label
|
||||
}
|
||||
},
|
||||
callback: options.callback
|
||||
});
|
||||
box.css({
|
||||
'top': '50%',
|
||||
'margin-top': function () {
|
||||
return -(box.height() / 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
return service;
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue