Changeset 529

Show
Ignore:
Timestamp:
08/30/08 11:55:14 (3 months ago)
Author:
jf.hovinne
Message:

Use mousedown event instead of mouseup. Partially fixes #67, Opera issue to be fixed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/wymeditor/jquery.wymeditor.js

    r525 r529  
    12821282  //jQuery(this._doc.body).find("*").bind("mouseup", this.mouseup); 
    12831283   
    1284   jQuery(this._doc.body).bind("mouseup", this.mouseup); 
     1284  jQuery(this._doc.body).bind("mousedown", this.mousedown); 
    12851285  var images = this._doc.body.getElementsByTagName("img"); 
    12861286  for(var i=0; i < images.length; i++) { 
    1287     jQuery(images[i]).bind("mouseup", this.mouseup); 
    1288   } 
    1289 }; 
    1290  
    1291 //mouseup handler 
    1292 WYMeditor.editor.prototype.mouseup = function(evt) { 
     1287    jQuery(images[i]).bind("mousedown", this.mousedown); 
     1288  } 
     1289}; 
     1290 
     1291WYMeditor.editor.prototype.mousedown = function(evt) { 
    12931292   
    12941293  var wym = WYMeditor.INSTANCES[this.ownerDocument.title]; 
    1295   if(this.tagName.toLowerCase() == WYMeditor.IMG) wym._selected_image = this; 
    1296   else wym._selected_image = null; 
     1294  wym._selected_image = (this.tagName.toLowerCase() == WYMeditor.IMG) ? this : null; 
    12971295  evt.stopPropagation(); 
    12981296};