MCPcopy Create free account
hub / github.com/codecombat/codecombat / search

Method search

app/core/treema-ext.js:646–659  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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()

Callers 2

showErrorFunction · 0.45
isProductionFunction · 0.45

Calls 3

getSearchResultsElMethod · 0.95
buildSearchURLMethod · 0.95
fetchMethod · 0.45

Tested by

no test coverage detected