Skip to content

Commit 896bba7

Browse files
committed
Better fix for image resize handles (IE & FF).
1 parent c206651 commit 896bba7

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

jquery.emojiarea.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
if (path.length && path.charAt(path.length - 1) !== '/') {
189189
path += '/';
190190
}
191-
return '<img src="' + path + filename + '" alt="' + util.htmlEntities(emoji) + '" contenteditable="false">';
191+
return '<img src="' + path + filename + '" alt="' + util.htmlEntities(emoji) + '">';
192192
};
193193

194194
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -239,6 +239,8 @@
239239
this.$editor.text($textarea.val());
240240
this.$editor.attr({contenteditable: 'true'});
241241
this.$editor.on('blur keyup paste', function() { return self.onChange.apply(self, arguments); });
242+
this.$editor.on('mousedown focus', function() { document.execCommand('enableObjectResizing', false, false); });
243+
this.$editor.on('blur', function() { document.execCommand('enableObjectResizing', true, true); });
242244

243245
var html = this.$editor.text();
244246
var emojis = $.emojiarea.icons;
@@ -267,6 +269,10 @@
267269
EmojiArea_WYSIWYG.prototype.insert = function(emoji) {
268270
var content;
269271
var $img = $(EmojiArea.createIcon(emoji));
272+
if ($img[0].attachEvent) {
273+
$img[0].attachEvent('onresizestart', function(e) { e.returnValue = false; }, false);
274+
}
275+
270276
util.replaceSelection($img[0]);
271277

272278
this.$editor.trigger('focus');

jquery.emojiarea.min.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)