cocoon-vanilla-js
cocoon-vanilla-js copied to clipboard
A vanilla JS replacement for (Rails) Cocoon's jQuery script
Current API Implementation ``` ... // node is HTML string. insertionNodeElem.insertAdjacentHTML(insertionMethod, node); insertionNodeElem.dispatchEvent( new CustomEvent('cocoon:after-insert', {detail: node, bubbles: true, cancelable: true}) ); ``` Proposed implementation ``` ... // node is...
Not sure why but this bug or something similar appears to be affecting this version. Appreciate this repo has no Jquery so unsure as to why. https://github.com/nathanvda/cocoon/pull/615 Having had a...
in the code we got: ```js if(typeof insertionNode === 'function') { if(insertionTraversal) { console.warn('association-insertion-traversal is ignored, because association-insertion-node is given as a function.'); } return insertionNode(btn); } ``` how exactly...