Open ghost opened 10 years ago
@k1-hedayati Just wanted to thank you for this.... I was running into the same issue you probably did, and your modified version works a treat!
Your welcome, but consider this that I'm not a JS programmer so my changes may be dirty or hacky and they need to be written with correct way :)
Hey there.
I just need to understand the use case. When and why do you prefer to clone/remove instead of append/hide?
Thanks Bjørn
Ninja edit: I have a table of errors thrown by an application, and the last cell has my trigger link and a hidden div
with the stack trace. I call the popup on the hidden div
like this:
$('.open-popup').click(function() {
$(this).siblings('.error-popup').bPopup();
});
.append()
moves that content into the popup, breaking that sibling relationship – once I open and close the popup, I can't use the same trigger to open it again. Cloning the content into the popup div preserves that relationship, so I can open and close at will. It's kind of an edgy case, but that's what worked for me.
This is the only quibble I've had with what has been a very helpful plugin, though – I appreciate all your hard work!
Have you tried setting the appending attribute to false?
No, but the problem was solved and I've since moved on. :) I'm pretty sure I read through the API docs before realising what the exact issue was, so I probably didn't even think to re-check. Thanks for calling it out here, though, so anybody coming here from Google like I did can try that first without having to resort to hackery.
This can be an option, but I don't have time for that, sorry. Emacs trimmed whitespace so diff seems messy.