I need to make a reference to a DOM node from an element in the editingarea. I always did this as editingAreaObject.reference = referencedNode and that worked fine, but now when I move the object in the editingarea the reference is lost, so I tried to set the reference with setAttribute, but accessing the reference seems to only return a string and thus I cannot find the referenced node's parentNode or anything else of it. Is there a way to set a reference and have it intact after moving the object?
Or some other options I have:
- Can I store an attribute (so that I can set an id to the referenced node) on objects in the editingarea and not have them in the published HTML?
- Can I detect whether an object has been moved? onafterobjectmoved or something like that.. This way I could reset all references.
- or maybe another option, can I find the real node by its reference? (I tried looping all possible nodes and comparing node == reference, but that didn't seem to work)