We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 072bf9b commit 9c28d22Copy full SHA for 9c28d22
code/jquery.suggestion.js
@@ -86,7 +86,7 @@
86
var $box = $this.parent();
87
var $suggestion = $("<div class='"+options.suggestionCls+"'><ul></ul></div>").appendTo($box);
88
var $list = $suggestion.find('ul');
89
- var $item = $list.find('li');
+ var $items = $list.find('li');
90
var _height = $this.outerHeight(false);
91
var _width = $this.outerWidth(false);
92
var _text = null;
@@ -209,8 +209,8 @@
209
// 成功后的回调函数
210
var success = function(data){
211
var list = options.onCallback.bind(_)(data);
212
+ $list.empty();
213
if(list&&list.length){
- $list.empty();
214
list.forEach(function(item){
215
$list.append('<li data-value="'+item['value']+'" data-name="'+item['name']+'">'+options.itemFormat(item)+'</li>');
216
});
@@ -313,4 +313,4 @@
313
getApi(_api);
314
315
};
316
-}));
+}));
0 commit comments