last day (14 days later) » 

09:39
Hi there
Hello. Thank you for joining.
If you have seen the last demo - jsfiddle.net/Lv145325 you could do something like that
Currently I have 10 modals in a page. So, I want to make sure, that each time the modal is loaded it is reset to default. (exactly similar to the initial one ) Let me show you some code.
Code for a modal named goal:
it also dynamically loads a field, where we could draw lines and move icons.
When I use the .html to copy and then paste the content. I loose out functionality.
Like I am unable to drag images. Also, I am unable to make ajax calls through buttons.
Is there any way, I could just reset the modal?
or may be kill it every time it gets hidden?
each modal has the same type of content?
or they are different?
Forms are different. But the image and icons over the image have the same class.
So, if I do something on modal, it reflects on all others.
*on one
09:51
Does the plugins you use have destroy option?
instead of updating the whole HTML, you could reset the form, and destroy plugins
then reapply these pluggins
it would be easiest way
I am not using any plugin! I am using an image. Over image I am using icon images.
I could reset form, but how do I reset the image?
I ask because you have mention in the comment about dragging option, I thought you use kinda jguery.draggable or something
Yes, I am using a library that helps me to drag items.
But it doesn't have a destroy optionn.
*option
I'm not sure how your images functionality works, what they suppose to do, how they're initialized, and what is the method used to drag them. I would go with html() (like in my last demo) but it need some loops, since you have more than one modal.
Is there any way to kill a modal?
10:06
no, there's no such functionality built in a bootstrap or js
That way you could store/restore html of each modal: jsfiddle.net/zk33kmfk
all modal is stored in a modalFreshContents array, with modal id as key. Then you can restore each modal depends on its id.
The other thing is about initialization of your images after restore. You have to handle that on your own, since I have no idea how that works (images functionality). In demo I have used jQuery.draggable, so you can get the idea of how to reinitialize plugin
And to make ajax calls through modals buttons you would need to use event delegation (like in demo)
10:24
ok

last day (14 days later) »