(file, i)
| 664 | if (!pos || options.readOnly) return; |
| 665 | if (files && files.length && window.FileReader && window.File) { |
| 666 | function loadFile(file, i) { |
| 667 | var reader = new FileReader; |
| 668 | reader.onload = function() { |
| 669 | text[i] = reader.result; |
| 670 | if (++read == n) { |
| 671 | pos = clipPos(pos); |
| 672 | operation(function() { |
| 673 | var end = replaceRange(text.join(""), pos, pos); |
| 674 | setSelectionUser(pos, end); |
| 675 | })(); |
| 676 | } |
| 677 | }; |
| 678 | reader.readAsText(file); |
| 679 | } |
| 680 | var n = files.length, text = Array(n), read = 0; |
| 681 | for (var i = 0; i < n; ++i) loadFile(files[i], i); |
| 682 | } |
no test coverage detected