Fixes and refactors
This commit is contained in:
		@@ -129,7 +129,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);
 | 
			
		||||
@@ -144,8 +143,8 @@
 | 
			
		||||
                selection.removeAllRanges();
 | 
			
		||||
                selection.addRange(range);
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            }
 | 
			
		||||
            highlightSyntax(editorEle.id);
 | 
			
		||||
            
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
@@ -166,7 +165,7 @@
 | 
			
		||||
 | 
			
		||||
            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);
 | 
			
		||||
@@ -180,9 +179,8 @@
 | 
			
		||||
                const selection = window.getSelection();
 | 
			
		||||
                selection.removeAllRanges();
 | 
			
		||||
                selection.addRange(range);
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            }
 | 
			
		||||
            highlightSyntax(transformEle.id);
 | 
			
		||||
            
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user