mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
Fix SweetAlert factory
This commit is contained in:
parent
173ef6b6fa
commit
35fbd3ba2a
@ -78,11 +78,10 @@ tasks:
|
||||
- public/html/**/*.html
|
||||
- bundle.json
|
||||
cmds:
|
||||
- ./node_modules/.bin/lessc resources/less/semaphore.less > public/css/semaphore.css
|
||||
- ./node_modules/.bin/pug resources/pug --out public/html
|
||||
- cp node_modules/font-awesome/fonts/* public/fonts
|
||||
- '{{ if eq OS "windows" }} .\\node_modules\\.bin\\lessc.cmd {{ else }} ./node_modules/.bin/lessc {{ end }} resources/less/semaphore.less > public/css/semaphore.css'
|
||||
- '{{ if eq OS "windows" }} .\\node_modules\\.bin\\pug.cmd --pretty {{ else }} ./node_modules/.bin/pug {{ end }} resources/pug --out public/html'
|
||||
- '{{ if eq OS "windows" }} xcopy node_modules\\font-awesome\\fonts public\\fonts /y {{ else }} cp node_modules/font-awesome/fonts/* public/fonts {{ end }}'
|
||||
- node bundler.js
|
||||
|
||||
compile:be:
|
||||
desc: Runs Packr for static assets
|
||||
sources:
|
||||
|
2655
web/package-lock.json
generated
2655
web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,11 @@
|
||||
app.factory('SweetAlert', [ '$rootScope', function ( $rootScope ) {
|
||||
var swal = window.swal;
|
||||
|
||||
return {
|
||||
swal: function (arg1, arg2, arg3) {
|
||||
swal: function () {
|
||||
var args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
$rootScope.$evalAsync(function () {
|
||||
if (typeof(arg2) === 'function') {
|
||||
SweetAlert.swal(arg1, function (isConfirm) {
|
||||
$rootScope.$evalAsync(function () {
|
||||
arg2(isConfirm);
|
||||
window.swal.apply(null, args).then(resolve);
|
||||
});
|
||||
}, arg3);
|
||||
} else {
|
||||
SweetAlert.swal(arg1, arg2, arg3);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user