"fixed error if FCKeditorAPI was not loaded (no FCK on the page), which cause the selected tab no longer be returned to the app"

This commit is contained in:
Ralf Becker 2007-05-11 15:04:03 +00:00
parent defef645e2
commit 8c71320f44

View File

@ -72,16 +72,19 @@ function activate_tab(tab,all_tabs,name)
// activate FCK in newly activated tab for Gecko browsers
if (!document.all)
{
var t = document.getElementById(tab);
var inputs = t.getElementsByTagName('input');
for (i = 0; i < inputs.length;i++) {
editor = FCKeditorAPI.GetInstance(inputs[i].name);
if (editor && editor.EditorDocument && editor.EditMode == FCK_EDITMODE_WYSIWYG) {
editor.SwitchEditMode();
editor.SwitchEditMode();
break;
}
try {
var t = document.getElementById(tab);
var inputs = t.getElementsByTagName('input');
for (i = 0; i < inputs.length;i++) {
editor = FCKeditorAPI.GetInstance(inputs[i].name);
if (editor && editor.EditorDocument && editor.EditMode == FCK_EDITMODE_WYSIWYG) {
editor.SwitchEditMode();
editor.SwitchEditMode();
break;
}
}
}
catch(e) { } // ignore the error if FCKeditorAPI is not loaded
}
if (name) {
set_element(document.eTemplate,name,tab);