mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Fixed bug with sidebox menus not opening when you double click on a menu entry: This was caused by the sidebox information sent from the server on the first time an application gets loaded not being parsed by the browser. This problem occured, because the iframe content which contained the sidebox information was immediately reloaded and the server doesn't send the information a second time
This commit is contained in:
parent
d95ad940c3
commit
5823f0a569
@ -657,10 +657,24 @@ class jdots_framework extends egw_framework
|
||||
*
|
||||
* @param $appname
|
||||
*/
|
||||
public function ajax_sidebox($appname)
|
||||
public function ajax_sidebox($appname, $md5)
|
||||
{
|
||||
$response = egw_json_response::get();
|
||||
$response->data($this->get_sidebox($appname));
|
||||
$sidebox = $this->get_sidebox($appname);
|
||||
$encoded = json_encode($sidebox);
|
||||
$new_md5 = md5($encoded);
|
||||
|
||||
$response_array = array();
|
||||
$response_array['md5'] = $new_md5;
|
||||
|
||||
if ($new_md5 != $md5)
|
||||
{
|
||||
//TODO: Add some proper solution to be able to attach the already
|
||||
//JSON data to the response in order to gain some performace improvements.
|
||||
$response_array['data'] = $sidebox;
|
||||
}
|
||||
|
||||
$response->data($response_array);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -177,6 +177,22 @@ egw_fw.prototype.setActiveApp = function(_app)
|
||||
{
|
||||
this.sidemenuUi.open(_app.sidemenuEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Probalby the sidemenu data just got lost along the way. This
|
||||
//for example happens, when a user double clicks on a menu item
|
||||
var req = new egw_json_request('home.jdots_framework.ajax_sidebox',
|
||||
[_app.appName, _app.sidebox_md5]);
|
||||
_app.sidemenuEntry.showAjaxLoader();
|
||||
req.sendRequest(false, function(data) {
|
||||
if ((typeof data.md5 != 'undefined') &&
|
||||
(typeof data.data != 'undefined'))
|
||||
{
|
||||
this.fw.setSidebox(this.app, data.data, data.md5);
|
||||
this.app.sidemenuEntry.hideAjaxLoader();
|
||||
}
|
||||
}, {'app' : _app, 'fw' : this});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -510,7 +526,7 @@ egw_fw.prototype.categoryOpenCloseCallback = function(_opened)
|
||||
// [this.tag.appName, this.catName, _opened]);
|
||||
//req.sendRequest(true);
|
||||
|
||||
/* Store the state of the category lokaly */
|
||||
/* Store the state of the category localy */
|
||||
this.tag.parentFw.categoryOpenCache[this.tag.appName + '#' + this.catName] = _opened;
|
||||
// this.tag.parentFw.scrollAreaUi.update();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user