Changeset 650


Ignore:
Timestamp:
03/30/10 22:57:06 (2 years ago)
Author:
mr_lundis
Message:

Fixing #201, designMode weren't initiated properly until editor got focus

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wymeditor/jquery.wymeditor.mozilla.js

    r649 r650  
    2828 
    2929WYMeditor.WymClassMozilla.prototype.initIframe = function(iframe) { 
    30  
     30    var wym = this; 
     31     
    3132    this._iframe = iframe; 
    3233    this._doc = iframe.contentDocument; 
     
    6364     
    6465    //bind editor focus events (used to reset designmode - Gecko bug) 
    65     jQuery(this._doc).bind("focus", this.enableDesignMode); 
     66    jQuery(this._doc).bind("focus", function () {  
     67        // Fix scope 
     68        wym.enableDesignMode.call(wym); 
     69    }); 
    6670     
    6771    //post-init functions 
     
    237241 
    238242WYMeditor.WymClassMozilla.prototype.enableDesignMode = function() { 
    239     if(this.designMode == "off") { 
     243    if(this._doc.designMode == "off") { 
    240244      try { 
    241         this.designMode = "on"; 
    242         this.execCommand("styleWithCSS", '', false); 
     245        this._doc.designMode = "on"; 
     246        this._doc.execCommand("styleWithCSS", '', false); 
    243247      } catch(e) { } 
    244248    } 
Note: See TracChangeset for help on using the changeset viewer.