Thomas Bruederli
2014-09-26 6c96b1b7cd0313ce0d3afaac03db65662e31be39
Initialize TinyMCE editor in rcmail.init() instead of a separate call after. This makes the edior ready when restoring a HTML message from localStorage (#1490016)
2 files modified
11 ■■■■ changed files
program/include/rcmail.php 6 ●●●● patch | view | raw | blame | history
program/js/app.js 5 ●●●●● patch | view | raw | blame | history
program/include/rcmail.php
@@ -1805,17 +1805,17 @@
            $lang = 'en';
        }
        $script = json_encode(array(
        $script = array(
            'mode'       => $mode,
            'lang'       => $lang,
            'skin_path'  => $this->output->get_skin_path(),
            'spellcheck' => intval($this->config->get('enable_spellcheck')),
            'spelldict'  => intval($this->config->get('spellcheck_dictionary'))
        ));
        );
        $this->output->include_script('tiny_mce/tiny_mce.js');
        $this->output->include_script('editor.js');
        $this->output->add_script("rcmail_editor_init($script)", 'docready');
        $this->output->set_env('html_editor_init', $script);
    }
    /**
program/js/app.js
@@ -187,6 +187,11 @@
    if (this.env.permaurl)
      this.enable_command('permaurl', 'extwin', true);
    // initialize html editor
    if (this.env.html_editor_init && window.rcmail_editor_init) {
      rcmail_editor_init(this.env.html_editor_init);
    }
    switch (this.task) {
      case 'mail':