()
| 659 | } |
| 660 | |
| 661 | searchCallback () { |
| 662 | const container = this.getSearchResultsEl().detach().empty() |
| 663 | let first = true |
| 664 | for (const model of Array.from(this.collection.models)) { |
| 665 | const row = $('<div></div>').addClass('treema-search-result-row') |
| 666 | const text = this.formatDocument(model) |
| 667 | if (text == null) { continue } |
| 668 | if (first) { row.addClass('treema-search-selected') } |
| 669 | first = false |
| 670 | row.text(text) |
| 671 | row.data('value', model) |
| 672 | container.append(row) |
| 673 | } |
| 674 | if (!this.collection.models.length) { |
| 675 | container.append($('<div>No results</div>')) |
| 676 | } |
| 677 | return this.getValEl().append(container) |
| 678 | } |
| 679 | |
| 680 | getSearchResultsEl () { return this.getValEl().find('.treema-search-results') } |
| 681 | getSelectedResultEl () { return this.getValEl().find('.treema-search-selected') } |
nothing calls this directly
no test coverage detected