* InfoLog: "No filter" favorite was not resetting filters anymore

This commit is contained in:
Ralf Becker 2014-10-23 12:42:24 +00:00
parent 050c91225a
commit 5549dd1fd2
2 changed files with 26 additions and 12 deletions

View File

@ -413,6 +413,15 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
for(var s in _set)
{
if (s == 'col_filter')
{
// allow apps setState() to reset all col_filter by using undefined or null for it
// they can not pass {} for _set / state.state, if they need to set something
if (_set.col_filter === undefined || _set.col_filter === null)
{
this.activeFilters.col_filter = {};
changed = true;
}
else
{
for(var c in _set.col_filter)
{
@ -430,6 +439,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
}
}
}
}
else if (this.activeFilters[s] !== _set[s])
{
this.activeFilters[s] = _set[s];

View File

@ -150,9 +150,13 @@ app.classes.infolog = AppJS.extend(
*/
setState: function(state)
{
if (typeof state.state.action == 'undefined') state.state.action = null;
if (typeof state.state.search == 'undefined') state.state.search = null;
// as we have to set state.state.action, we have to set all other
// for "No filter" favorite to work as expected
var to_set = {col_filter: null, filter: '', filter2: '', cat_id: '', search: '', action: null};
for(var name in to_set)
{
if (typeof state.state[name] == 'undefined') state.state[name] = to_set[name];
}
return this._super.apply(this, arguments);
},