alecpl
2010-03-31 4cdc70941d5d25f47f920c6ba62035d2e6978454
- Fix js error when switching editor mode (#1486593)


1 files modified
9 ■■■■■ changed files
program/js/editor.js 9 ●●●●● patch | view | raw | blame | history
program/js/editor.js
@@ -75,10 +75,12 @@
{
  if (rcmail.env.task == 'mail') {
    var editor = tinyMCE.get(rcmail.env.composebody);
    if (editor) {
    var textarea = editor.getElement();
    var node = editor.getContentAreaContainer().childNodes[0];
    if (textarea && node)
      node.tabIndex = textarea.tabIndex;
    }
  }
}
@@ -98,8 +100,9 @@
    rcmail.display_spellcheck_controls(false);
    rcmail.plain2html(composeElement.value, textAreaId);
    tinyMCE.execCommand('mceAddControl', true, textAreaId);
    rcmail_editor_tabindex();
    tinyMCE.execCommand('mceToggleEditor', false, textAreaId);
    // #1486593
    setTimeout("rcmail_editor_tabindex();", 500);
    if (flagElement && (flag = rcube_find_object(flagElement)))
      flag.value = '1';
    }
@@ -118,7 +121,7 @@
      rcmail.html2plain(existingHtml, textAreaId);
      }
    tinyMCE.execCommand('mceRemoveControl', true, textAreaId);
    tinyMCE.execCommand('mceToggleEditor', false, textAreaId);
    rcmail.display_spellcheck_controls(true);
    if (flagElement && (flag = rcube_find_object(flagElement)))
      flag.value = '0';