From 4104f793b245d6bc2e5fca22619a6d25f3538a31 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 14 Jul 2014 14:11:41 +0000 Subject: [PATCH] Call applyFilters() function instead of setting directly, which skipped change detection. Fixes selection not cleared when applying a favorite. --- etemplate/js/et2_extension_nextmatch.js | 9 ++++++++- phpgwapi/js/jsapi/app_base.js | 3 +-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 4e1b9a0ba8..c4e2daac5c 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -387,6 +387,14 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], * @param _set filter(s) to set eg. { filter: '' } to reset filter in NM header */ applyFilters: function(_set) { + var changed = false; + + // Cleared explicitly + if(typeof _set != 'undefined' && jQuery.isEmptyObject(_set)) + { + changed = true; + this.activeFilters = {}; + } if(typeof this.activeFilters == "undefined") { this.activeFilters = {col_filter: {}}; @@ -396,7 +404,6 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], this.activeFilters.col_filter = {}; } - var changed = false; if (typeof _set == 'object') { for(var s in _set) diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index 6a95167240..1ed8cf87dd 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -285,8 +285,7 @@ var AppJS = Class.extend( if(state.state && state.state.search) state.state.search = unescape(state.state.search); // Apply - _widget.activeFilters = state.state || state.filter || {}; - _widget.applyFilters(); + _widget.applyFilters(state.state || state.filter || {}); nextmatched = true; }, this, et2_nextmatch); if(nextmatched) return false;