Revision 9d3e8723
Added by Phil Davis almost 9 years ago
src/usr/local/www/diag_edit.php | ||
---|---|---|
156 | 156 |
|
157 | 157 |
// calculate start/end |
158 | 158 |
var startPos = 0, endPos = tarea.value.length; |
159 |
for(var x = 0; x < lines.length; x++) { |
|
160 |
if(x == lineNum) { |
|
159 |
for (var x = 0; x < lines.length; x++) {
|
|
160 |
if (x == lineNum) {
|
|
161 | 161 |
break; |
162 | 162 |
} |
163 | 163 |
startPos += (lines[x].length+1); |
... | ... | |
169 | 169 |
// do selection |
170 | 170 |
// Chrome / Firefox |
171 | 171 |
|
172 |
if(typeof(tarea.selectionStart) != "undefined") { |
|
172 |
if (typeof(tarea.selectionStart) != "undefined") {
|
|
173 | 173 |
tarea.focus(); |
174 | 174 |
tarea.selectionStart = startPos; |
175 | 175 |
tarea.selectionEnd = endPos; |
Also available in: Unified diff
Code style and comments
No functional change - just making style consistent