File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -397,17 +397,10 @@ the specific language governing permissions and limitations under the Apache Lic
397397
398398 // TODO javadoc
399399 function tags ( data ) {
400- // TODO even for a function we should probably return a wrapper that does the same object/string check as
401- // the function for arrays. otherwise only functions that return objects are supported.
402- if ( $ . isFunction ( data ) ) {
403- return data ;
404- }
405-
406- // if not a function we assume it to be an array
407-
400+ var isFunc = $ . isFunction ( data ) ;
408401 return function ( query ) {
409402 var t = query . term , filtered = { results : [ ] } ;
410- $ ( data ) . each ( function ( ) {
403+ $ ( isFunc ? data ( ) : data ) . each ( function ( ) {
411404 var isObject = this . text !== undefined ,
412405 text = isObject ? this . text : this ;
413406 if ( t === "" || query . matcher ( t , text ) ) {
You can’t perform that action at this time.
0 commit comments