tinymins / vue-transfer-dom.js

A directive supported plugin for transfering DOM to another location in Vue.js components.
https://www.npmjs.com/package/vue-transfer-dom.js
1 stars 1 forks source link

Support for cloning source element on multiple target nodes #6

Open emahuni opened 5 years ago

emahuni commented 5 years ago

classes and multiple elements

When '.class-selector' is used as the target it may result in multiple targets in the NodeList. Instead of ignoring the others and using one, make a clone of the source element for each target node in the Nodelist.

tinymins commented 5 years ago

I think this may should not be supported, cause this library is to transfer DOM from somewhere to another place, but not clone DOM. Also, clone DOM may cause some other problems. For example, transfered node contains child DOM with id, clone it will cause a global DOM id conflict. What's more, cloning a audio tag or a video tag, play state and progress should be consider, which is to complicated for this library.

emahuni commented 5 years ago

I have implemented that, and I understand your issues, but I think this is dependant on the developer who will be using the package.

My implementation has become very very very different from yours and I don't know if I should merge with this. I am thinking of creating a different package and then you can get the code that is relevant with yours from there so as to not cause conflicts or breaking changes. Tell me if you think I should create a PR.

emahuni commented 5 years ago

The implementation:

emahuni commented 5 years ago

i did the above before you responded, just when I saw your package a few days ago