Update main.js

This commit is contained in:
Kyle
2019-04-18 20:16:46 -07:00
parent ddb3440cb3
commit 9901a8a313

View File

@@ -29,7 +29,7 @@ function scrollFunction() {
} }
function textAreaKeyPressed() { function textAreaKeyPressed() {
if (event.keyCode == 13) { if (event.key == "Enter" || event.key == "Return") {
setTimeout(function() { setTimeout(function() {
cursorIndex = document.getElementById("inputText").selectionStart cursorIndex = document.getElementById("inputText").selectionStart
document.getElementById("inputText").value = document.getElementById("inputText").value.slice(0, cursorIndex) + "{line}" + document.getElementById("inputText").value.slice(cursorIndex, 0) document.getElementById("inputText").value = document.getElementById("inputText").value.slice(0, cursorIndex) + "{line}" + document.getElementById("inputText").value.slice(cursorIndex, 0)