()
| 644 | buildSearchURL (term) { return `${this.url}?term=${term}&project=true` } |
| 645 | |
| 646 | search () { |
| 647 | const term = this.getValEl().find('input').val() |
| 648 | if (term === this.lastTerm) { return } |
| 649 | |
| 650 | if (this.lastTerm && !term) { this.getSearchResultsEl().empty() } |
| 651 | if (!term) { return } |
| 652 | this.lastTerm = term |
| 653 | this.getSearchResultsEl().empty().append('Searching') |
| 654 | this.collection = new LatestVersionCollection([], { model: this.model }) |
| 655 | |
| 656 | this.collection.url = this.buildSearchURL(term) |
| 657 | this.collection.fetch() |
| 658 | return this.collection.once('sync', this.searchCallback, this) |
| 659 | } |
| 660 | |
| 661 | searchCallback () { |
| 662 | const container = this.getSearchResultsEl().detach().empty() |
no test coverage detected