Changeset 620


Ignore:
Timestamp:
05/02/09 21:57:21 (3 years ago)
Author:
jf.hovinne
Message:

Fix #147 (thanks jan).

File:
1 edited

Legend:

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

    r619 r620  
    852852   
    853853  //handle keyup event on html value: set the editor value 
    854   jQuery(this._box).find(this._options.htmlValSelector).keyup(function() { 
    855     jQuery(wym._doc.body).html(jQuery(this).val()); 
    856   }); 
    857    
     854  //handle focus/blur events to check if the element has focus, see #147 
     855  jQuery(this._box).find(this._options.htmlValSelector) 
     856    .keyup(function() { jQuery(wym._doc.body).html(jQuery(this).val());}) 
     857    .focus(function() { jQuery(this).toggleClass('hasfocus'); }) 
     858    .blur(function() { jQuery(this).toggleClass('hasfocus'); }); 
     859 
    858860  //handle click event on classes buttons 
    859861  jQuery(this._box).find(this._options.classSelector).click(function() { 
     
    11461148  var html = this.xhtml(); 
    11471149  jQuery(this._element).val(html); 
    1148   jQuery(this._box).find(this._options.htmlValSelector).val(html); 
     1150  jQuery(this._box).find(this._options.htmlValSelector).not('.hasfocus').val(html); //#147 
    11491151}; 
    11501152 
Note: See TracChangeset for help on using the changeset viewer.