From 042db5996a17eef4122eba3777e558a51e620c85 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 13 Dec 2013 00:09:40 +0000 Subject: [PATCH] use egw_link_handler to stop calendar reload whole framework when switching away from listview --- calendar/inc/class.calendar_ui.inc.php | 6 +++--- calendar/js/navigation.js | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index b93dbff3a4..c060902510 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -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('', - '','/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' => " \n". diff --git a/calendar/js/navigation.js b/calendar/js/navigation.js index d426c0affb..19a356f3f6 100644 --- a/calendar/js/navigation.js +++ b/calendar/js/navigation.js @@ -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