MOSS 2007 Document list in firefox

The documentlist is strangly rendered in Firefox. Not that it is the only bug for SharePoint in Firefox, but fixing them one by one, might end up working :-)

When loading a page with a documentlist, the content of the webpart is placed right, but jumps down under the weppart and ontop of the underlying content.

This indicates, that it is some javascript-code messing it up. And it is. In the webpart, there is an IFrame (urgh!) that might contain the toolbar. But, when it is empty, the source of the iframe is just a blank.gif. Then, the iframe itself has an onload-function, that modify the height of iframe when the source is different from '/_layouts/images/blank.gif' by using "if (this.src != '/_layouts/images/blank.gif')...". Unfortunately this test is always true in Firefox as this.src includes protocol and domain.

Include the following code in the header of your page or masterpage will fix it.

if (window.addEventListener)
    window.addEventListener("DOMContentLoaded", fixIFrame, false);
function fixIFrame(){
    iframes = document.getElementsByTagName('IFRAME');
    for(var i=0;i<iframes.length;i++) {
        if (iframes[i].src.indexOf('/_layouts/images/blank.gif')>-1)
            iframes[i].onload = '';
    }
}

 

 

Sidst opdateret: 16. dec.  2016

Submenu