MCPcopy Index your code
hub / github.com/codecombat/codecombat / searchCallback

Method searchCallback

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

Source from the content-addressed store, hash-verified

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') }

Callers

nothing calls this directly

Calls 3

getSearchResultsElMethod · 0.95
formatDocumentMethod · 0.95
dataMethod · 0.80

Tested by

no test coverage detected