set_preference now accepts an additional callback parameter, passed on to jsonq

This commit is contained in:
Nathan Gray 2014-07-08 03:34:05 +00:00
parent db5fb7a86a
commit a3a1d500ee

View File

@ -79,10 +79,11 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function() {
* @param {string} _app application name or "common" * @param {string} _app application name or "common"
* @param {string} _name name of the pref * @param {string} _name name of the pref
* @param {string} _val value of the pref * @param {string} _val value of the pref
* @param {function} _callback Function passed along to the queue, called after preference is set server-side
*/ */
set_preference: function(_app, _name, _val) set_preference: function(_app, _name, _val, _callback)
{ {
this.jsonq('home.egw_framework.ajax_set_preference.template',[_app, _name, _val]); this.jsonq('home.egw_framework.ajax_set_preference.template',[_app, _name, _val], _callback);
// update own preference cache, if _app prefs are loaded (dont update otherwise, as it would block loading of other _app prefs!) // update own preference cache, if _app prefs are loaded (dont update otherwise, as it would block loading of other _app prefs!)
if (typeof prefs[_app] != 'undefined') prefs[_app][_name] = _val; if (typeof prefs[_app] != 'undefined') prefs[_app][_name] = _val;