Fixes and refactors
This commit is contained in:
@@ -1243,7 +1243,6 @@
|
||||
|
||||
if (document.queryCommandSupported('insertText')) {
|
||||
document.execCommand('insertText', false, text);
|
||||
highlightSyntax(editorEle.id);
|
||||
} else {
|
||||
// Insert text at the current position of caret
|
||||
const range = document.getSelection().getRangeAt(0);
|
||||
@@ -1257,10 +1256,8 @@
|
||||
const selection = window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
|
||||
|
||||
}
|
||||
|
||||
highlightSyntax(editorEle.id);
|
||||
});
|
||||
|
||||
const transformEle = document.getElementById('transformArea');
|
||||
@@ -1280,7 +1277,6 @@
|
||||
|
||||
if (document.queryCommandSupported('insertText')) {
|
||||
document.execCommand('insertText', false, text);
|
||||
highlightSyntax(transformEle.id);
|
||||
} else {
|
||||
// Insert text at the current position of caret
|
||||
const range = document.getSelection().getRangeAt(0);
|
||||
@@ -1294,10 +1290,8 @@
|
||||
const selection = window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
|
||||
|
||||
}
|
||||
|
||||
highlightSyntax(transformEle.id);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user