codepb/jquery-template

afterInsert happens before element is added to document

BradCOnGitHub opened this issue · 1 comments

The afterInsert callback is executed while the copy of the template being added is detached from the document. The side effect that caused me a problem is that jQuery.data() gets removed when the node finally gets added.

I looked at trying to fix it myself but didn't see an easy solution. Instead I just made an example of the problem:

http://pastebin.com/e2hxg1Y6

Will test and update version later to ensure this is fixed.