dixso/custombox

Close method manual usage

Closed this issue · 2 comments

Hello.
Im not sure if it is a real problem, but cuz of very poor documentation ive decided to fix that problem by myself. Before i added additional condition to this place
if(!this.options.content.clone&&e.test(this.options.content.target))this.element.childNodes[0].setAttribute("style",this.reference.getAttribute("style")) calling Custombox.modal.close() directly from script (not from onclick event on element) was giving 4+ errors in console.
Now this part in my script looks like that
if(!this.options.content.clone&&e.test(this.options.content.target)&&this.element.childNodes[0])this.element.childNodes[0].setAttribute("style",this.reference.getAttribute("style"))

Another problem was fixed much easier and maybe exists only in my environment but still..
After closing modal it didnt removes main container "#custombox-%modal-id%.custombox-content so i had to do it manually using onClose callback.

Maybe all this happened only cuz of my bad, if so i would like to know what exactly i did wrong or where should i look. In other case it would be awesome to have a new version of this awesome plugin without listed problems.

P.S sorry for bad English

dixso commented

Hi @logeeka,
Is solved in the next release.
If you have another problem, please put an example in jsfiddle.net.

Regards

dcb99 commented

Has this really been fixed? I am currently having this issue. The div with custombox-content doesn't get removed when calling close() or closeAll()