{
$this->_buildIndents($this->_root_nodes);
- return 'window.' . $this->_instance . '.renderTree(' . Horde_Serialize::serialize($this->_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . Horde_Serialize::serialize($this->_root_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . ($this->_static ? 'true' : 'false') . ')';
+ return 'window.' . $this->_instance . '.renderTree(' . Horde_Serialize::serialize($this->_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . Horde_Serialize::serialize($this->_root_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . ($this->_static ? 'true' : 'false') . ');';
}
}
new Ajax.PeriodicalUpdater(
'horde_menu',
horde_sidebar_url,
- { parameters: { httpclient: 1 },
- method: 'get',
- evalScripts: true,
- frequency: horde_sidebar_refresh }
+ {
+ parameters: { httpclient: 1 },
+ method: 'get',
+ evalScripts: true,
+ frequency: horde_sidebar_refresh,
+ onSuccess: function ()
+ {
+ var layout = $('horde_menu').getLayout();
+ $('horde_menu').setStyle({
+ width: layout.get('width') + 'px',
+ height: layout.get('height') + 'px'
+ });
+ }
+ }
);
}
};
-Event.observe(window, 'load', function() {
+document.observe('dom:loaded', function() {
$('hiddenSidebar').hide();
if (HordeSidebar.getCookie('horde_sidebar_expanded', true).toString() != $('expandedSidebar').visible().toString()) {
HordeSidebar.toggleMenuFrame();
// updated node javascript.
if (Horde_Util::getFormData('httpclient')) {
header('Content-Type: application/json; charset=' . Horde_Nls::getCharset());
- echo Horde::wrapInlineScript(array($tree->renderNodeDefinitions()));
+ $scripts = array(
+ $tree->renderNodeDefinitions(),
+ '$(\'horde_menu\').setStyle({ width: \'auto\', height: \'auto\' });');
+ echo Horde::wrapInlineScript($scripts);
exit;
}