From c388c552587e6e7fa4e801f7b537e2509f5a231d Mon Sep 17 00:00:00 2001 From: ikeblaster Date: Thu, 31 Jan 2019 15:53:18 +0000 Subject: [PATCH] Overrides were merging into default SweetAlertConfig Introduced in e39ce7587c116e93f974f95dafbe94bea19c9b21 --- SweetAlert.js | 2 +- SweetAlert.min.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SweetAlert.js b/SweetAlert.js index a15fad5..ba1594d 100644 --- a/SweetAlert.js +++ b/SweetAlert.js @@ -28,7 +28,7 @@ swal: function (arg1, arg2, arg3) { //merge with default config - var arg1 = angular.extend(SweetAlertConfig, arg1); + arg1 = angular.extend(angular.copy(SweetAlertConfig), arg1); $rootScope.$evalAsync(function () { if (typeof(arg2) === 'function') { diff --git a/SweetAlert.min.js b/SweetAlert.min.js index d00b138..4112691 100644 --- a/SweetAlert.min.js +++ b/SweetAlert.min.js @@ -1 +1,3 @@ -"use strict";angular.module("oitozero.ngSweetAlert",[]).factory("SweetAlert",["$rootScope",function($rootScope){var swal=window.swal,self={swal:function(arg1,arg2,arg3){$rootScope.$evalAsync(function(){"function"==typeof arg2?swal(arg1,function(isConfirm){$rootScope.$evalAsync(function(){arg2(isConfirm)})},arg3):swal(arg1,arg2,arg3)})},success:function(title,message){$rootScope.$evalAsync(function(){swal(title,message,"success")})},error:function(title,message){$rootScope.$evalAsync(function(){swal(title,message,"error")})},warning:function(title,message){$rootScope.$evalAsync(function(){swal(title,message,"warning")})},info:function(title,message){$rootScope.$evalAsync(function(){swal(title,message,"info")})},showInputError:function(message){$rootScope.$evalAsync(function(){swal.showInputError(message)})},close:function(){$rootScope.$evalAsync(function(){swal.close()})}};return self}]); +(function(e,b){"function"===typeof define&&define.amd?define(["angular","sweetalert"],b):"object"===typeof module&&module.exports?module.exports=b(require("angular"),require("sweetalert")):b(e.angular,e.swal)})(this,function(e,b){e.module("oitozero.ngSweetAlert",[]).factory("SweetAlert",["$rootScope","SweetAlertConfig",function(d,g){return{swal:function(a,c,f){a=e.extend(e.copy(g),a);d.$evalAsync(function(){"function"===typeof c?b(a,function(a){d.$evalAsync(function(){c(a)})},f):b(a,c,f)})},success:function(a, +c){d.$evalAsync(function(){b(a,c,"success")})},error:function(a,c){d.$evalAsync(function(){b(a,c,"error")})},warning:function(a,c){d.$evalAsync(function(){b(a,c,"warning")})},info:function(a,c){d.$evalAsync(function(){b(a,c,"info")})},showInputError:function(a){d.$evalAsync(function(){b.showInputError(a)})},close:function(){d.$evalAsync(function(){b.close()})}}}]).constant("SweetAlertConfig",{title:"",text:"",type:null,allowOutsideClick:!1,showConfirmButton:!0,showCancelButton:!1,closeOnConfirm:!0, +closeOnCancel:!0,confirmButtonText:"OK",confirmButtonColor:"#8CD4F5",cancelButtonText:"Cancel",imageUrl:null,imageSize:null,timer:null,customClass:"",html:!1,animation:!0,allowEscapeKey:!0,inputType:"text",inputPlaceholder:"",inputValue:"",showLoaderOnConfirm:!1})}); \ No newline at end of file