Clearer if we just do init within onload function
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 23 Dec 2009 19:35:29 +0000 (12:35 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 24 Dec 2009 04:15:40 +0000 (21:15 -0700)
imp/js/compose-dimp.js

index 3cef833..a82b784 100644 (file)
@@ -425,16 +425,6 @@ var DimpCompose = {
         return document.viewport.getHeight() - $('composeMessageParent').cumulativeOffset()[1] - this.mp_padding;
     },
 
-    initializeSpellChecker: function()
-    {
-        document.observe('SpellChecker:noerror', this._onSpellCheckNoError.bind(this));
-
-        if (DIMP.conf_compose.rte_avail) {
-            document.observe('SpellChecker:after', this._onSpellCheckAfter.bind(this));
-            document.observe('SpellChecker:before', this._onSpellCheckBefore.bind(this));
-        }
-    },
-
     _onSpellCheckAfter: function()
     {
         if (this.editor_on) {
@@ -817,7 +807,13 @@ var DimpCompose = {
         $('submit_frame').observe('load', this.attachmentComplete.bind(this));
 
         this.resizeMsgArea();
-        this.initializeSpellChecker();
+
+        // Initialize spell checker
+        document.observe('SpellChecker:noerror', this._onSpellCheckNoError.bind(this));
+        if (DIMP.conf_compose.rte_avail) {
+            document.observe('SpellChecker:after', this._onSpellCheckAfter.bind(this));
+            document.observe('SpellChecker:before', this._onSpellCheckBefore.bind(this));
+        }
 
         // Automatically resize address fields.
         this.resizeto = new ResizeTextArea('to', boundResize);