ExtLoader - xfInsert: some hidden elements are displayed

cclaerhout

Well-known member
I'm not sure this topic should be in the bug, questions forums or here, but when some html (& css & js) are inserted using the XenForo xfInsert function which is wrapped inside the external loader some elements which should be hidden (their css are for example: display: none) are still displayed.

Example:
Code:
	$templateHtml = $(ajaxData.templateHtml);

	new XenForo.ExtLoader(ajaxData, function()
        {
		$templateHtml.xfInsert('replaceAll', self.trigger, 'xfFadeIn');
	});

Here's a workaround but I don't understand this behaviour:
Code:
	$templateHtml = $(ajaxData.templateHtml);
           
	$hideThis = $templateHtml.filter(function( index ) {
		if(this.style) {
			return $(this).css('display') == 'none';
		}
	})

	new XenForo.ExtLoader(ajaxData, function()
        {
		$templateHtml.xfInsert('replaceAll', self.trigger, 'xfFadeIn');
		$hideThis.hide();
	});
 
I'm not sure this topic should be in the bug, questions forums or here, but when some html (& css & js) are inserted using the XenForo xfInsert function which is wrapped inside the external loader some elements which should be hidden (their css are for example: display: none) are still displayed.

Example:
Code:
    $templateHtml = $(ajaxData.templateHtml);

    new XenForo.ExtLoader(ajaxData, function()
        {
        $templateHtml.xfInsert('replaceAll', self.trigger, 'xfFadeIn');
    });

Here's a workaround but I don't understand this behaviour:
Code:
    $templateHtml = $(ajaxData.templateHtml);
          
    $hideThis = $templateHtml.filter(function( index ) {
        if(this.style) {
            return $(this).css('display') == 'none';
        }
    })

    new XenForo.ExtLoader(ajaxData, function()
        {
        $templateHtml.xfInsert('replaceAll', self.trigger, 'xfFadeIn');
        $hideThis.hide();
    });
Hi,

Thanks for helping me out earlier.

I'm using ExtLoader in my jscript so that I can use xfInsert. Do you happen to know what ExtLoader does and why it's needed??

Thanks.
 
Top Bottom