(file, i)
| 464 | if (!pos || options.readOnly) return; |
| 465 | if (files && files.length && window.FileReader && window.File) { |
| 466 | function loadFile(file, i) { |
| 467 | var reader = new FileReader; |
| 468 | reader.onload = function() { |
| 469 | text[i] = reader.result; |
| 470 | if (++read == n) { |
| 471 | pos = clipPos(pos); |
| 472 | operation(function() { |
| 473 | var end = replaceRange(text.join(""), pos, pos); |
| 474 | setSelectionUser(pos, end); |
| 475 | })(); |
| 476 | } |
| 477 | }; |
| 478 | reader.readAsText(file); |
| 479 | } |
| 480 | var n = files.length, text = Array(n), read = 0; |
| 481 | for (var i = 0; i < n; ++i) loadFile(files[i], i); |
| 482 | } |
no test coverage detected