forked from extern/egroupware
Don't send mail rows when opening mail app, but use client side cache instead.
Gives large speed improvements when changing to previously opened folders.
This commit is contained in:
parent
df76846b37
commit
73c1f064b9
@ -421,6 +421,8 @@ class mail_ui
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$content[self::$nm_index]['num_rows'] = 0; // Do not send any rows with initial request
|
||||||
$content[self::$nm_index]['default_cols'] = 'status,attachments,subject,address,date,size'; // I columns to use if there's no user or default pref (! as first char uses all but the named columns), default all columns
|
$content[self::$nm_index]['default_cols'] = 'status,attachments,subject,address,date,size'; // I columns to use if there's no user or default pref (! as first char uses all but the named columns), default all columns
|
||||||
$content[self::$nm_index]['csv_fields'] = false;
|
$content[self::$nm_index]['csv_fields'] = false;
|
||||||
if ($msg)
|
if ($msg)
|
||||||
|
@ -65,6 +65,11 @@ app.classes.mail = AppJS.extend(
|
|||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
this._super.apply(this,arguments);
|
this._super.apply(this,arguments);
|
||||||
|
|
||||||
|
// Turn on client side, persistent cache
|
||||||
|
// egw.data system runs encapsulated below etemplate, so this must be
|
||||||
|
// done before the nextmatch is created.
|
||||||
|
this.egw.dataCacheRegister('mail',this.nm_cache, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,6 +86,10 @@ app.classes.mail = AppJS.extend(
|
|||||||
$j(nm).off('refresh');
|
$j(nm).off('refresh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unregister client side cache
|
||||||
|
this.egw.dataCacheUnregister('mail');
|
||||||
|
|
||||||
delete this.et2_obj;
|
delete this.et2_obj;
|
||||||
// call parent
|
// call parent
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
@ -255,6 +264,32 @@ app.classes.mail = AppJS.extend(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback function for dataFetch caching.
|
||||||
|
*
|
||||||
|
* We only cache the first chunk (50 rows), and only if search filter is not set,
|
||||||
|
* but we cache this for every combination of folder, filter & filter2.
|
||||||
|
*
|
||||||
|
* @param {object} query_context Query information from egw.dataFetch()
|
||||||
|
* @returns {string|false} Cache key, or false to not cache
|
||||||
|
*/
|
||||||
|
nm_cache: function(query_context)
|
||||||
|
{
|
||||||
|
// Only cache first chunk of rows, if no search filter
|
||||||
|
if((!query_context || !query_context.start) && query_context.count == 0 && !(
|
||||||
|
query_context.self._filters.search || false)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Make sure keys match, even if some filters are not defined
|
||||||
|
return JSON.stringify({
|
||||||
|
selectedFolder: query_context.self._filters.selectedFolder || '',
|
||||||
|
filter: query_context.self._filters.filter || '',
|
||||||
|
filter2: query_context.self._filters.filter2
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mail rebuild Action menu On nm-list
|
* mail rebuild Action menu On nm-list
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user