Fixed Preview - first init - xfActivate execution position

cclaerhout

Well-known member
Licensed customer
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();
 
I think this was the only situation like that, so I've changed it now. Thanks.
 
Back
Top Bottom