Fix SweetAlert factory

This commit is contained in:
Denis 2018-05-04 14:20:03 +05:00
parent 173ef6b6fa
commit 35fbd3ba2a
3 changed files with 2664 additions and 17 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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);
}
});
}
};