mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
use app[appname].setState if available to allow app to overwrite it (eg. change to non-listview in calendar)
This commit is contained in:
parent
c6e891952b
commit
3e13b3f77b
@ -179,7 +179,7 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
|
||||
var stored_filters = {
|
||||
'blank': {
|
||||
name: this.egw().lang("No filters"),
|
||||
state: {},
|
||||
state: {}
|
||||
}
|
||||
};
|
||||
|
||||
@ -194,7 +194,7 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
|
||||
// Keep older favorites working - they used to store nm filters in 'filters',not state
|
||||
if(preferences[pref_name].filters)
|
||||
{
|
||||
stored_filters[pref_name].state = preferences[pref_name].filters
|
||||
stored_filters[pref_name].state = preferences[pref_name].filters;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -250,9 +250,17 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
|
||||
onclick: function(node) {
|
||||
// Apply preferred filter - make sure it's an object, and not a reference
|
||||
if(this.preferred && this.stored_filters[this.preferred])
|
||||
{
|
||||
// use app[appname].setState if available to allow app to overwrite it (eg. change to non-listview in calendar)
|
||||
if (typeof app[this.options.app] != 'undefined')
|
||||
{
|
||||
app[this.options.app].setState(this.stored_filters[this.preferred]);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.set_nm_filters(jQuery.extend({},this.stored_filters[this.preferred].state));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(this.egw().lang("No default set"));
|
||||
@ -317,6 +325,8 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
|
||||
/**
|
||||
* Set the nextmatch to filter
|
||||
* From et2_INextmatchHeader interface
|
||||
*
|
||||
* @param {et2_nextmatch} nextmatch
|
||||
*/
|
||||
setNextmatch: function(nextmatch)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user