fix en translation is always used for common, caused by preferences had a stub default preference for common AND egw.includeJS immediatly called callback for a file just sheduled to be loaded, but not yet arrived

This commit is contained in:
Ralf Becker 2014-01-15 17:39:07 +00:00
parent b56175a0f4
commit 53c6059d84
2 changed files with 11 additions and 15 deletions

View File

@ -164,10 +164,12 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd)
i--; // as index will be incr by for!
}
}
// check if all files already included --> call callback right away
// check if all files already included or sheduled to be included --> call callback via egw_LAB.wait
if (!_jsFiles.length)
{
_callback.call(_context);
egw_LAB.wait(function(){
_callback.call(_context);
});
return;
}

View File

@ -24,19 +24,13 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function() {
*
* @access: private, use egw.preferences() or egw.set_perferences()
*/
var prefs = {
common: {
dateformat: "Y-m-d",
timeformat: 24,
lang: "en"
}
};
var prefs = {};
// Return the actual extension
return {
/**
* Setting prefs for an app or 'common'
*
*
* @param object _data object with name: value pairs to set
* @param string _app application name, 'common' or undefined to prefes of all apps at once
*/
@ -54,15 +48,15 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function() {
/**
* Query an EGroupware user preference
*
*
* If a prefernce is not already loaded (only done for "common" by default), it is synchroniosly queryed from the server!
*
*
* @param string _name name of the preference, eg. 'dateformat', or '*' to get all the application's preferences
* @param string _app='common'
* @return string preference value
* @todo add a callback to query it asynchron
*/
preference: function(_name, _app)
preference: function(_name, _app)
{
if (typeof _app == 'undefined') _app = 'common';
@ -79,9 +73,9 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function() {
/**
* Set a preference and sends it to the server
*
*
* Server will silently ignore setting preferences, if user has no right to do so!
*
*
* @param string _app application name or "common"
* @param string _name name of the pref
* @param string _val value of the pref