()
| 93 | } |
| 94 | |
| 95 | runSearch () { |
| 96 | if (this.destroyed) { return } |
| 97 | const term = this.$el.find('input#search').val() |
| 98 | if (this.sameSearch(term)) { return } |
| 99 | this.removeOldSearch() |
| 100 | |
| 101 | const options = { |
| 102 | queryParams: this.queryParams, |
| 103 | } |
| 104 | this.collection = new SearchCollection(this.modelURL, this.model, term, this.projection, this.limit, options) |
| 105 | this.collection.term = term // needed? |
| 106 | if (!this.archived) { |
| 107 | this.collection.url += '&archived=false' |
| 108 | } |
| 109 | this.listenTo(this.collection, 'sync', this.onSearchChange) |
| 110 | this.showLoading(this.$el.find('.results')) |
| 111 | |
| 112 | this.updateHash(term) |
| 113 | return this.collection.fetch() |
| 114 | } |
| 115 | |
| 116 | updateHash (term) { |
| 117 | const newPath = document.location.pathname + (term ? '#' + term : '') |
nothing calls this directly
no test coverage detected