paste text/plain instead of html in Ox.EditableContent

This commit is contained in:
j 2013-09-26 21:35:05 +00:00
parent bc792641e6
commit 6e6da8e000

View file

@ -87,6 +87,14 @@ Ox.EditableContent = function(options, self) {
}, },
paste: function(e) { paste: function(e) {
Ox.print('PASTE', e); Ox.print('PASTE', e);
if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) {
Ox.print('TYPES', e.originalEvent.clipboardData.types);
var value = e.originalEvent.clipboardData.getData('text/plain');
document.execCommand('insertHTML', false, value);
e.originalEvent.stopPropagation();
e.originalEvent.preventDefault();
return false;
}
} }
}) })
.bindEvent({ .bindEvent({