Skip to content

Commit

Permalink
Merge pull request #334 from LotarProject/LotarProject-itemTitle
Browse files Browse the repository at this point in the history
Added itemTitle function/option to set menu item title
  • Loading branch information
bassjobsen authored Jan 15, 2018
2 parents c4d9b9e + ced51d3 commit d46435e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bootstrap3-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit d46435e

Please sign in to comment.