Created
January 9, 2012 20:33
-
-
Save stuross/1584791 to your computer and use it in GitHub Desktop.
change to generickey.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
valueMatches : function(facet, searchTerm, callback) { | |
if('results' in facets.raw[facet]){ | |
callback(facets.raw[facet].results); | |
} else{ | |
var app_label = facets.raw[facet].app_label, | |
model = facet; | |
// TODO: don't pound the server | |
$.getJSON("/admin/" + app_label + "/" + model + "/search/", {q: searchTerm}, function(data) { | |
facets.raw[facet].results = data.results; | |
callback(data.results); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment