use egw_link_handler to stop calendar reload whole framework when switching away from listview

This commit is contained in:
Ralf Becker 2013-12-13 00:09:40 +00:00
parent a79f7b87a6
commit 042db5996a
2 changed files with 11 additions and 8 deletions

View File

@ -679,7 +679,7 @@ class calendar_ui
),
array(
'text' => lang('listview'),
'value' => 'menuaction=calendar.calendar_uilist.listview',
'value' => 'menuaction=calendar.calendar_uilist.listview&ajax=true',
'selected' => $this->view == 'listview',
),
) as $data)
@ -694,7 +694,7 @@ class calendar_ui
$file[++$n] = array(
'text' => html::form('<input name="keywords" value="'.$value.'" style="width: 97.5%;"'.
' placeholder="'.$blur.'" title="'.lang('Search').'">',
'','/index.php',array('menuaction'=>'calendar.calendar_uilist.listview')),
'','/index.php',array('menuaction'=>'calendar.calendar_uilist.listview','ajax'=>'true')),
'no_lang' => True,
'link' => False,
'icon' => false,
@ -798,7 +798,7 @@ class calendar_ui
$current_view_url = egw::link('/index.php',array(
'menuaction' => $this->view_menuaction,
'date' => $this->date,
),false);
)+($this->view == 'listview' ? array('ajax' => 'true') : array()),false);
$file[] = array(
'text' => "
<script type=\"text/javascript\" src=\"{$GLOBALS['egw_info']['server']['webserver_url']}/calendar/js/navigation.js\" id=\"calendar-navigation-script\" data-current-view-url=\"".htmlspecialchars($current_view_url)."\"/></script>\n".

View File

@ -32,13 +32,15 @@
}
if (owner) {
if (typeof no_reset == 'unknown') no_reset = false;
egw_appWindow('calendar').location=url+'&owner='+(no_reset?'':'0,')+owner;
url += '&owner='+(no_reset?'':'0,')+owner;
if (url.match('&ajax=true')) url = url.replace('&ajax=true', '')+'&ajax=true';
egw_link_handler(url, 'calendar');
}
}
/**
* Load template specific app.css file in top window too as sidebox needs it
*
*
* @returns {Boolean}
*/
function load_top_app_css()
@ -73,7 +75,7 @@
load_top_app_css();
// change handlers setting a certain url, eg. view
$j('#calendar_view').change(function(){
calendar_window.location = egw_webserverUrl+'/index.php?'+this.value;
egw_link_handler(egw_webserverUrl+'/index.php?'+this.value, 'calendar');
});
// calendar owner selection change
$j('#uical_select_owner,#uical_select_resource').change(function(e){
@ -87,8 +89,9 @@
$j('#calendar_merge,#calendar_filter,#calendar_cat_id').change(function(){
var val = $j(this).val();
if ($j.isArray(val)) val = val.join(',');
calendar_window.location = current_view_url+
(current_view_url.search.length ? '&' : '?')+this.name+'='+val;
var url = current_view_url+(current_view_url.search.length ? '&' : '?')+this.name+'='+val;
if (url.match('&ajax=true')) url = url.replace('&ajax=true', '')+'&ajax=true';
egw_link_handler(url, 'calendar');
if (this.name == 'merge') this.value='';
});
// click handler to switch selectbox to multiple