#717: prevent flicker of unstyled content: make the pane visible only when their content is ready... + watchdog in case of error.

SVN:trunk[2725]
This commit is contained in:
Denis Flaven
2013-05-14 10:03:23 +00:00
parent 7cae338e6d
commit a6c9bcf780
2 changed files with 12 additions and 1 deletions

View File

@@ -141,6 +141,7 @@ class iTopWebPage extends NiceWebPage
}
});
window.clearTimeout(iPaneVisWatchDog);
myLayout.addPinBtn( "#tPinMenu", "west" );
//myLayout.open( "west" );
$('.ui-layout-resizer-west .ui-layout-toggler').css({background: 'transparent'});
@@ -391,6 +392,11 @@ EOF
});
function FixPaneVis()
{
$('.ui-layout-center, .ui-layout-north, .ui-layout-south').css({display: 'block'});
}
EOF
);
}
@@ -562,7 +568,7 @@ EOF
}
$sHtml .= "<script type=\"text/javascript\" src=\"$s_script\"></script>\n";
}
$this->add_script("\$(document).ready(function() {\n{$this->m_sInitScript};\nwindow.setTimeout('onDelayedReady()',10)\n});");
$this->add_script("var iPaneVisWatchDog = window.setTimeout('FixPaneVis()',5000);\n\$(document).ready(function() {\n{$this->m_sInitScript};\nwindow.setTimeout('onDelayedReady()',10)\n});");
if (count($this->m_aReadyScripts)>0)
{
$this->add_script("\nonDelayedReady = function() {\n".implode("\n", $this->m_aReadyScripts)."\n}\n");

View File

@@ -8,6 +8,11 @@ body {
overflow: hidden; /* Remove scroll bars on browser window */
}
/* to prevent flicker, hide the pane's content until it's ready */
.ui-layout-center, .ui-layout-north, .ui-layout-south {
display: none;
}
.raw_output {
font-family: Courier-New, Courier, Arial, Helvetica;
font-size: 8pt;