Skip to content

Commit 203bcc0

Browse files
[과제 번역] focus와 blur 과제, Edit TD on click 번역
1 parent 89b5def commit 203bcc0

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

2-ui/4-forms-controls/2-focus-blur/4-edit-td-click/solution.view/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<link rel="stylesheet" href="my.css">
1111

1212

13-
<p>Click on a table cell to edit it. Press OK or CANCEL when you finish.</p>
13+
<p>수정하려는 셀을 클릭하세요. 완료 또는 취소 버튼을 눌러 동작을 마무리할 수 있습니다.</p>
1414

1515
<table id="bagua-table">
1616
<tr>
17-
<th colspan="3"><em>Bagua</em> Chart: Direction, Element, Color, Meaning</th>
17+
<th colspan="3"><em>Bagua</em> Chart(팔괘도): Direction, Element, Color, Meaning</th>
1818
</tr>
1919
<tr>
2020
<td class="nw"><strong>Northwest</strong>

2-ui/4-forms-controls/2-focus-blur/4-edit-td-click/solution.view/script.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let editingTd;
44

55
table.onclick = function(event) {
66

7-
// 3 possible targets
7+
// 총 3개의 타겟(셀, 완료, 취소)
88
let target = event.target.closest('.edit-cancel,.edit-ok,td');
99

1010
if (!table.contains(target)) return;
@@ -14,7 +14,7 @@ table.onclick = function(event) {
1414
} else if (target.className == 'edit-ok') {
1515
finishTdEdit(editingTd.elem, true);
1616
} else if (target.nodeName == 'TD') {
17-
if (editingTd) return; // already editing
17+
if (editingTd) return; // 셀을 수정 중인 경우
1818

1919
makeTdEditable(target);
2020
}
@@ -27,7 +27,7 @@ function makeTdEditable(td) {
2727
data: td.innerHTML
2828
};
2929

30-
td.classList.add('edit-td'); // td is in edit state, CSS also styles the area inside
30+
td.classList.add('edit-td'); // 수정 중인 td의 스타일을 변경
3131

3232
let textArea = document.createElement('textarea');
3333
textArea.style.width = td.clientWidth + 'px';
@@ -40,7 +40,7 @@ function makeTdEditable(td) {
4040
textArea.focus();
4141

4242
td.insertAdjacentHTML("beforeEnd",
43-
'<div class="edit-controls"><button class="edit-ok">OK</button><button class="edit-cancel">CANCEL</button></div>'
43+
'<div class="edit-controls"><button class="edit-ok">완료</button><button class="edit-cancel">취소</button></div>'
4444
);
4545
}
4646

2-ui/4-forms-controls/2-focus-blur/4-edit-td-click/source.view/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<link rel="stylesheet" href="my.css">
1111

1212

13-
<p>Click on a table cell to edit it. Press OK or CANCEL when you finish.</p>
13+
<p>수정하려는 셀을 클릭하세요. 완료 또는 취소 버튼을 눌러 동작을 마무리할 수 있습니다.</p>
1414

1515
<table id="bagua-table">
1616
<tr>
17-
<th colspan="3"><em>Bagua</em> Chart: Direction, Element, Color, Meaning</th>
17+
<th colspan="3"><em>Bagua</em> Chart(팔괘도): Direction, Element, Color, Meaning</th>
1818
</tr>
1919
<tr>
2020
<td class="nw"><strong>Northwest</strong>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
let table = document.getElementById('bagua-table');
22

3-
/* your code */
3+
/* 여기에 코드를 작성하세요. */

0 commit comments

Comments
 (0)