Skip to content

Commit

Permalink
fixes for issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
bassjobsen committed Sep 7, 2013
1 parent 07ae3ee commit 04d3712
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
<td>1</td>
<td>The minimum character length needed before triggering autocomplete suggestions</td>
</tr>
<tr>
<td>scrollHeight</td>
<td>number, function</td>
<td>0</td>
<td>Number of pixels the scollable parent container scrolled down (scrolled out the viewport)</td>
</tr>
<tr>
<td>matcher</td>
<td>function</td>
Expand Down
9 changes: 7 additions & 2 deletions bootstrap3-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@
, show: function () {
var pos = $.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight
})
}), scrollHeight

scrollHeight = typeof this.options.scrollHeight == 'function' ?
this.options.scrollHeight.call() :
this.options.scrollHeight

this.$menu
.insertAfter(this.$element)
.css({
top: pos.top + pos.height
top: pos.top + pos.height + scrollHeight
, left: pos.left
})
.show()
Expand Down Expand Up @@ -311,6 +315,7 @@
, menu: '<ul class="typeahead dropdown-menu"></ul>'
, item: '<li><a href="#"></a></li>'
, minLength: 1
, scrollHeight: 0
}

$.fn.typeahead.Constructor = Typeahead
Expand Down

0 comments on commit 04d3712

Please sign in to comment.