Call applyFilters() function instead of setting directly, which skipped change detection.

Fixes selection not cleared when applying a favorite.
This commit is contained in:
Nathan Gray 2014-07-14 14:11:41 +00:00
parent ea23bb151a
commit 4104f793b2
2 changed files with 9 additions and 3 deletions

View File

@ -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 * @param _set filter(s) to set eg. { filter: '' } to reset filter in NM header
*/ */
applyFilters: function(_set) { applyFilters: function(_set) {
var changed = false;
// Cleared explicitly
if(typeof _set != 'undefined' && jQuery.isEmptyObject(_set))
{
changed = true;
this.activeFilters = {};
}
if(typeof this.activeFilters == "undefined") if(typeof this.activeFilters == "undefined")
{ {
this.activeFilters = {col_filter: {}}; this.activeFilters = {col_filter: {}};
@ -396,7 +404,6 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
this.activeFilters.col_filter = {}; this.activeFilters.col_filter = {};
} }
var changed = false;
if (typeof _set == 'object') if (typeof _set == 'object')
{ {
for(var s in _set) for(var s in _set)

View File

@ -285,8 +285,7 @@ var AppJS = Class.extend(
if(state.state && state.state.search) state.state.search = unescape(state.state.search); if(state.state && state.state.search) state.state.search = unescape(state.state.search);
// Apply // Apply
_widget.activeFilters = state.state || state.filter || {}; _widget.applyFilters(state.state || state.filter || {});
_widget.applyFilters();
nextmatched = true; nextmatched = true;
}, this, et2_nextmatch); }, this, et2_nextmatch);
if(nextmatched) return false; if(nextmatched) return false;