Removed formatting from HEditorWidget on copy & paste

This commit is contained in:
andystrobel 2014-10-23 19:04:42 +02:00
parent ed266f1867
commit a527976f6e

View File

@ -86,6 +86,24 @@
} }
}) })
$('#<?php echo $id; ?>_contenteditable').on('paste',function(event) {
// disable standard behavior
event.preventDefault();
// get clipbord content
var text = (event.originalEvent || event).clipboardData.getData('text/html');
// create jQuey object and paste content
var $result = $('<div></div>').append($(text))
// set plain text at current cursor position
insertTextAtCursor($result.text());
})
$('#<?php echo $id; ?>_contenteditable').keypress(function (e) { $('#<?php echo $id; ?>_contenteditable').keypress(function (e) {
if (e.which == 13) { if (e.which == 13) {
// insert a space by hitting enter for a clean convert of user guids // insert a space by hitting enter for a clean convert of user guids