jquery-confirm icon indicating copy to clipboard operation
jquery-confirm copied to clipboard

Bug on var.close() (externally close the dialog)

Open r-pv opened this issue 3 years ago • 0 comments

jquery-confirm version: v3.3.4

I'm submitting a ... (check one with "x") [X] bug report [ ] feature request [ ] support request

Current behavior: I got an error while trying to close the dialog externally.

Expected behavior: To close the dialog window externally.

Steps to reproduce: So I use a dialog window to show a "loading" message, then I made an AJAX request, when the ajax got a reply depending on the reply either use the dialog to show an error message or I close the window and show the request content. This error appears randomly sometimes quite often sometimes very rarely.

Related code: //so I do something like: rDWA('loading...'); jQuery.get(url,function(e){ if(e){ rDWA();//close; showresults(); }else{ rDWA('Error!','',{c:'red',}); } });

insert any relevant code here //DIALOG.WINDOWS; var _dw=[null,null,null,];

//DIALOG.ALERT; function rDWA(i=false,s=false,t={}){ if(_dw[0]!=null){try{_dw[0].close();}catch(e){console.log([e,_dw[0]]);if(_dw[0].isOpen()){_dw[0].toggle();}}} if(i){_dw[0]=jQuery.dialog({closeIcon:(t.x!=undefined)?t.x:true,escapeKey:(t.e!=undefined)?t.e:false,title:(s)?s:'',type:(t.c)?t.c:'blue',content:i,boxWidth:(t.w)?t.w:'300px',useBootstrap:false,draggable:false,});}}

Other information: The problem occurs when I try to close the window, I receive a error message: TypeError: that.$el is undefined Previously I was receiving an error about the $titleContainer instead. I checked a bit the code an realize that if I turn off the drageable var won't enter to the if(){} that includes the call to the $titleContainer variable and yes, it works but now there is a different error, so I'm guessing the dialog window it's not properly being created. Now, is this an error mine o it is a bug?,

thanks all for your time.

r-pv avatar Jun 29 '22 23:06 r-pv