From 64f6aad5a2c7c55a4a45c2b25b09ae5015c52db4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 8 Sep 2014 15:55:00 +0000 Subject: [PATCH] nextmatch responses got cached for in meantime changed folder --- mail/js/app.js | 14 +++++++------- phpgwapi/js/jsapi/egw_data.js | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 182ec033d6..93fe2a8547 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -295,17 +295,17 @@ app.classes.mail = AppJS.extend( { // Only cache first chunk of rows, if no search filter if((!query_context || !query_context.start) && query_context.count == 0 && - query_context.self._filters.selectedFolder && - !(!query_context.self._filters || query_context.self._filters.search) + query_context.filters && query_context.filters.selectedFolder && + !(!query_context.filters || query_context.filters.search) ) { // Make sure keys match, even if some filters are not defined // using JSON.stringfy() directly gave a crash in Safari 7.0.4 return this.egw.jsonEncode({ - selectedFolder: query_context.self._filters.selectedFolder || '', - filter: query_context.self._filters.filter || '', - filter2: query_context.self._filters.filter2 || '', - sort: query_context.self._filters.sort + selectedFolder: query_context.filters.selectedFolder || '', + filter: query_context.filters.filter || '', + filter2: query_context.filters.filter2 || '', + sort: query_context.filters.sort }); } return false; @@ -3078,7 +3078,7 @@ app.classes.mail = AppJS.extend( this.compose_resizeHandler(); return true; }, - + /** * Upload for import (VFS) * diff --git a/phpgwapi/js/jsapi/egw_data.js b/phpgwapi/js/jsapi/egw_data.js index 9470e25bf9..d477ad1b20 100644 --- a/phpgwapi/js/jsapi/egw_data.js +++ b/phpgwapi/js/jsapi/egw_data.js @@ -419,6 +419,9 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { } } } + // create a clone of filters, which can be used in parseServerResponse and cache callbacks + // independent of changes happening while waiting for the response + _context.filters = jQuery.extend({}, _filters); var request = egw.json( _app+".etemplate_widget_nextmatch.ajax_get_rows.etemplate", [