Fixed new lines in paste data
This commit is contained in:
parent
b2f2734533
commit
4d97ba5f84
@ -239,6 +239,7 @@ define([
|
||||
}
|
||||
undoMgr.saveSelectionState();
|
||||
}
|
||||
|
||||
var nextTickAdjustScroll = false;
|
||||
var debouncedSave = utils.debounce(function() {
|
||||
save();
|
||||
@ -759,9 +760,18 @@ define([
|
||||
}, 0);
|
||||
})
|
||||
.on('mouseup', _.bind(selectionMgr.saveSelectionState, selectionMgr, true, false))
|
||||
.on('paste', function() {
|
||||
.on('paste', function(evt) {
|
||||
undoMgr.currentMode = 'paste';
|
||||
adjustCursorPosition();
|
||||
try {
|
||||
var data = evt.originalEvent.clipboardData.getData("text/plain");
|
||||
if(data) {
|
||||
evt.preventDefault();
|
||||
document.execCommand("insertHTML", false, data);
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
})
|
||||
.on('cut', function() {
|
||||
undoMgr.currentMode = 'cut';
|
||||
|
Loading…
Reference in New Issue
Block a user