WIP EGroupware tutorial:

- Make sure to not create etemplate2 object for an empty container
- Fix fallback lang not working
This commit is contained in:
Hadi Nategh 2015-09-28 09:34:09 +00:00
parent 9fce06e650
commit 1d43c74ea6

View File

@ -1018,6 +1018,8 @@ var AppJS = Class.extend(
{ {
//DOM container //DOM container
var div = document.getElementById('egw_tutorial_'+egw.app_name()+'_sidebox'); var div = document.getElementById('egw_tutorial_'+egw.app_name()+'_sidebox');
if (!div) return;
// et2 object // et2 object
var etemplate = new etemplate2 (div, false); var etemplate = new etemplate2 (div, false);
var template = egw.webserverUrl+'/etemplate/templates/default/egw_tutorial.xet'; var template = egw.webserverUrl+'/etemplate/templates/default/egw_tutorial.xet';
@ -1027,7 +1029,7 @@ var AppJS = Class.extend(
var content = {content:{list:[]}}; var content = {content:{list:[]}};
if (_data && _data[egw.app_name()]) if (_data && _data[egw.app_name()])
{ {
if (_data[egw.app_name()][lang] == 'undefined' || _data[egw.app_name()][lang].length == 0 ) lang = 'en'; if (!_data[egw.app_name()][lang]) lang = 'en';
if (typeof _data[egw.app_name()][lang] !='undefined' if (typeof _data[egw.app_name()][lang] !='undefined'
&& _data[egw.app_name()][lang].length > 0) && _data[egw.app_name()][lang].length > 0)
{ {