Skip to content

Commit

Permalink
fix a img popover bug in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
farthinker committed Oct 16, 2014
1 parent 2951109 commit 6b4e673
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/simditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3707,9 +3707,9 @@ ImageButton = (function(_super) {
range = document.createRange();
range.selectNode($img[0]);
_this.editor.selection.selectRange(range);
setTimeout(function() {
return _this.editor.body.focus();
}, 0);
if (!_this.editor.util.supportSelectionChange) {
_this.editor.trigger('selectionchanged');
}
return false;
};
})(this));
Expand Down
6 changes: 3 additions & 3 deletions site/assets/scripts/simditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3707,9 +3707,9 @@ ImageButton = (function(_super) {
range = document.createRange();
range.selectNode($img[0]);
_this.editor.selection.selectRange(range);
setTimeout(function() {
return _this.editor.body.focus();
}, 0);
if (!_this.editor.util.supportSelectionChange) {
_this.editor.trigger('selectionchanged');
}
return false;
};
})(this));
Expand Down
4 changes: 1 addition & 3 deletions src/buttons/image.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ class ImageButton extends Button
range = document.createRange()
range.selectNode $img[0]
@editor.selection.selectRange range
setTimeout =>
@editor.body.focus()
, 0
@editor.trigger 'selectionchanged' unless @editor.util.supportSelectionChange

false

Expand Down

0 comments on commit 6b4e673

Please sign in to comment.