diff --git a/bootstrap3-typeahead.js b/bootstrap3-typeahead.js index bbcc7c3..431fb82 100644 --- a/bootstrap3-typeahead.js +++ b/bootstrap3-typeahead.js @@ -58,6 +58,7 @@ this.updater = this.options.updater || this.updater; this.displayText = this.options.displayText || this.displayText; this.itemLink = this.options.itemLink || this.itemLink; + this.itemTitle = this.options.itemTitle || this.itemTitle; this.followLinkOnSelect = this.options.followLinkOnSelect || this.followLinkOnSelect; this.source = this.options.source; this.delay = this.options.delay; @@ -353,6 +354,7 @@ if(this.followLinkOnSelect) { i.find('a').attr('href', self.itemLink(item)); } + i.find('a').attr('title', self.itemTitle(item)); if (text == self.$element.val()) { i.addClass('active'); self.$element.data('active', item); @@ -377,6 +379,10 @@ return null; }, + itemTitle: function (item) { + return null; + }, + next: function (event) { var active = this.$menu.find('.active').removeClass('active'); var next = active.next();