Fixed HTML code paste
This commit is contained in:
parent
a667f9e933
commit
0356c9e60c
@ -758,16 +758,11 @@ define([
|
|||||||
.on('mouseup', _.bind(selectionMgr.saveSelectionState, selectionMgr, true, false))
|
.on('mouseup', _.bind(selectionMgr.saveSelectionState, selectionMgr, true, false))
|
||||||
.on('paste', function(evt) {
|
.on('paste', function(evt) {
|
||||||
undoMgr.currentMode = 'paste';
|
undoMgr.currentMode = 'paste';
|
||||||
|
evt.preventDefault();
|
||||||
|
var data = (evt.originalEvent || evt).clipboardData.getData('text/plain') || prompt('Paste something...');
|
||||||
|
data = escape(data);
|
||||||
adjustCursorPosition();
|
adjustCursorPosition();
|
||||||
try {
|
document.execCommand('insertHtml', false, data);
|
||||||
var data = evt.originalEvent.clipboardData.getData("text/plain");
|
|
||||||
if(data) {
|
|
||||||
evt.preventDefault();
|
|
||||||
document.execCommand("insertHTML", false, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.on('cut', function() {
|
.on('cut', function() {
|
||||||
undoMgr.currentMode = 'cut';
|
undoMgr.currentMode = 'cut';
|
||||||
|
Loading…
Reference in New Issue
Block a user