Closed masklinn closed 12 years ago
I don't think this fits with any sizable use cases, but it's a fine change to make on a fork. Considering it's such a minor code change, a fork would be just as easy to pull from. But I only see this adding complexity, and if you're already custom rendering at this stage beyond what the callbacks and events provide, then you will likely have to do some serious heroics anyhow.
Currently, VisualSearch will always instantiate a
VS.ui.SearchFacet
when rendering a facet model.On a project I'm working on, I need some facets (inserted programmatically, see pull request 49) to have slightly special renderings or behaviors.
To that end, I simply added a make_facet callback option which defaults to
VS.ui.SearchFacet
and should return some sort ofVS.ui.SearchFacet
-like backbone view. Because JS constructors will use an explicitly returned value if any, make_facet can be a simple function as long as all code paths return a view instance.