Add support for setting your own text in the suggestions indicator #16

Merged
merged 2 commits into from Apr 5, 2012
@@ -73,6 +73,13 @@ describe('suggest', function() {
expect($input.next().next("span").hasClass("foo")).toBeTruthy();
});
+ it('should allow setting the text for the suggestions indicator', function() {
+ var $input = $("#search").suggest(["foo"], {
+ 'moreIndicatorText': "something else..."
+ });
+ expect($input.next().next("span").text()).toEqual('something else...');
+ });
+
// TEST: CSS & Attrbutes
it('should set the input background color to transparent', function() {
var $input = $("#search").suggest(["foo"]);
@@ -19,7 +19,8 @@
var settings = $.extend({
suggestionColor : '#ccc',
- moreIndicatorClass : 'suggest-more'
+ moreIndicatorClass : 'suggest-more',
+ moreIndicatorText : '…'
@cabgfx
cabgfx Apr 5, 2012 Contributor

My editor is a troll, sry. :trollface:

}, options);
return this.each(function() {
@@ -60,7 +61,7 @@
},
'class' : settings.moreIndicatorClass
})
- .html('…')
+ .html(settings.moreIndicatorText)
.hide();
$this