Skip to content

Commit

Permalink
Fix image selection bug for Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
jgdavey authored and parndt committed Jun 20, 2010
1 parent c1161f7 commit dff0174
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions public/javascripts/wymeditor/jquery.refinery.wymeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1563,15 +1563,11 @@ WYMeditor.editor.prototype.listen = function() {
//because of MSIE + jQuery + expando issue (#JQ1143)
//$(this._doc.body).find("*").bind("mouseup", this.mouseup);

/* $(this._doc.body).bind("mousedown", this.mousedown);
$(this._doc.body).bind("mousedown", this.mousedown);
var images = this._doc.body.getElementsByTagName("img");
for(var i=0; i < images.length; i++) {
$(images[i]).bind("mousedown", this.mousedown);
}
*/

// this may make things better.
$(this._doc.body).bind("mousedown", this.mousedown);

// ensure links can't be navigated to.
$(this._doc).find('a[href]').click(function(e){e.preventDefault();});
Expand All @@ -1581,7 +1577,7 @@ WYMeditor.editor.prototype.mousedown = function(evt) {

var wym = WYMeditor.INSTANCES[this.ownerDocument.title];
wym._selected_image = (evt.target.tagName.toLowerCase() == WYMeditor.IMG) ? evt.target : null;
evt.stopPropagation();
if (!$.browser.webkit) evt.stopPropagation();
};

/********** SKINS **********/
Expand Down

0 comments on commit dff0174

Please sign in to comment.