Open YPCrumble opened 7 years ago
@vdw for now I'll use the suggestion in #34, I believe that's the current suggested implementation. Feel free to close this if you think that's the best solution.
My current workaround is to change .text
to .html
and add my nodata
string as HTML. I'm somewhat concerned it could lead to an XSS vulnerability but the input is not generated by the user.
Thanks for building this library! I appreciate that it's more design oriented than some of the alternatives. I've been able to quickly incorporate it into sites without hassle which has been fantastic.
My suggestion:
I'd like to create an alternate method for the current
nodata
option. My issue is that I would like mynodata
option to include html markup. Currently this isn't possible because it's added via jQuery'stext
method.My suggestion is to allow the user to add a class to any items that should be hidden unless the search returns nothing. This is similar in functionality to the
exclude
option, except that these items would be hidden by default and revealed if there is no match, whereasexclude
items are shown by default.If the
nodata
flag is passed, we would still remove these list items as an override.Would a PR for this be welcome? Thanks for your consideration!