Fix setting class attribute on spellcheck results DIV
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 19 Feb 2010 06:36:47 +0000 (23:36 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 19 Feb 2010 06:36:47 +0000 (23:36 -0700)
horde/js/SpellChecker.js

index c89de2b..7d2442f 100644 (file)
@@ -105,7 +105,7 @@ var SpellChecker = Class.create({
 
     onComplete: function(request)
     {
-        var bad, content, d,
+        var bad, content,
             i = 0,
             result = request.responseJSON;
 
@@ -140,14 +140,13 @@ var SpellChecker = Class.create({
         }, this);
 
         if (!this.reviewDiv) {
-            this.reviewDiv = new Element('div', { className: this.target.readAttribute('className') }).addClassName('spellcheck').setStyle({ overflow: 'auto' });
+            this.reviewDiv = new Element('DIV', { className: this.target.readAttribute('class') }).addClassName('spellcheck').setStyle({ overflow: 'auto' });
             if (this.resumeOnDblClick) {
                 this.reviewDiv.observe('dblclick', this.resume.bind(this));
             }
         }
 
-        d = this.target.getDimensions();
-        this.reviewDiv.setStyle({ width: d.width + 'px', height: d.height + 'px'});
+        this.reviewDiv.setStyle({ width: this.target.clientWidth + 'px', height: this.target.clientHeight + 'px'});
 
         if (!this.htmlAreaParent) {
             content = content.replace(/~~~/g, '<br />');