• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Preview - first init - xfActivate execution position

cclaerhout

Well-known member
#1
This might have been done on purpose, but in the below code, shouldn't xfActivate be done after the prependTo? I've got some custom scripts that refuse to load when the activation is done before the elements are in the dom.
Code:
            $preview = $('<div />', { 'class': 'PreviewContainer'})
               .hide()
               .html(ajaxData.templateHtml)
               .xfActivate()
               .prependTo($form);
But they will load if I click again because this time the activation is done after after:
Code:
$preview.html(ajaxData.templateHtml).xfActivate();