Start styling output box. Remove readonly.
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<title>HTML 5 Boilerplate</title>
|
<title>HTML 5 Boilerplate</title>
|
||||||
<!-- <link rel="stylesheet" href="style.css"> -->
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>CodeList</h1>
|
<h1>CodeList</h1>
|
||||||
@@ -27,10 +27,6 @@
|
|||||||
Output
|
Output
|
||||||
</h3>
|
</h3>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
|
||||||
<label for="checkbox-read-only">Read-only?</label>
|
|
||||||
<input id="checkbox-read-only" type="checkbox">
|
|
||||||
</div>
|
|
||||||
<div id="output">
|
<div id="output">
|
||||||
<div id="gutter"></div>
|
<div id="gutter"></div>
|
||||||
<div contenteditable="true" id="output-area" class="output-area"></div>
|
<div contenteditable="true" id="output-area" class="output-area"></div>
|
||||||
@@ -39,7 +35,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const readOnlyCheckbox = document.getElementById("checkbox-read-only");
|
|
||||||
|
|
||||||
const gutter = document.getElementById("gutter");
|
const gutter = document.getElementById("gutter");
|
||||||
const outputArea = document.getElementById("output-area");
|
const outputArea = document.getElementById("output-area");
|
||||||
@@ -53,10 +48,6 @@
|
|||||||
return outputArea.children.length;
|
return outputArea.children.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
readOnlyCheckbox.addEventListener("change", (event) => {
|
|
||||||
outputArea.readOnly = readOnlyCheckbox.checked;
|
|
||||||
})
|
|
||||||
|
|
||||||
function updateGutterLineCount() { // TODO: Refactor so its not slow when theres more
|
function updateGutterLineCount() { // TODO: Refactor so its not slow when theres more
|
||||||
gutter.innerHTML = ""
|
gutter.innerHTML = ""
|
||||||
console.log("update gutter line count")
|
console.log("update gutter line count")
|
||||||
|
|||||||
16
public/style.css
Normal file
16
public/style.css
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#output-area {
|
||||||
|
border-right: 2px solid grey;
|
||||||
|
width: 30ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
#output-area:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#gutter {
|
||||||
|
background-color: rgb(230, 230, 230);
|
||||||
|
}
|
||||||
|
|
||||||
|
#output {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user