From 1d43c74ea6af329f2ed24f7efb3e3ed7bd9cbf1b Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 28 Sep 2015 09:34:09 +0000 Subject: [PATCH] WIP EGroupware tutorial: - Make sure to not create etemplate2 object for an empty container - Fix fallback lang not working --- phpgwapi/js/jsapi/app_base.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index 4f5eed5dbd..36f874ba55 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -1018,6 +1018,8 @@ var AppJS = Class.extend( { //DOM container var div = document.getElementById('egw_tutorial_'+egw.app_name()+'_sidebox'); + if (!div) return; + // et2 object var etemplate = new etemplate2 (div, false); var template = egw.webserverUrl+'/etemplate/templates/default/egw_tutorial.xet'; @@ -1027,7 +1029,7 @@ var AppJS = Class.extend( var content = {content:{list:[]}}; 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' && _data[egw.app_name()][lang].length > 0) {