Make name completion pop above instead of below, and increase to 5 maximum names

(imported from commit e663b8e6815c282c6233cd8ed560a82dccc6c507)
This commit is contained in:
Leo Franchi
2013-06-05 15:23:44 -04:00
parent 3bc234f920
commit 68b890ac0a
2 changed files with 13 additions and 4 deletions

View File

@@ -1815,6 +1815,7 @@
this.$menu = $(this.options.menu).appendTo('body')
this.source = this.options.source
this.shown = false
this.dropup = this.options.dropup
this.listen()
}
@@ -1839,9 +1840,14 @@
height: this.$element[0].offsetHeight
})
var top_pos = pos.top + pos.height
if (this.dropup) {
top_pos = pos.top - this.$menu.outerHeight()
}
this.$menu.css({
top: pos.top + pos.height
, left: pos.left
top: top_pos
, left: pos.left
})
this.$menu.show()
@@ -2069,6 +2075,7 @@
, item: '<li><a href="#"></a></li>'
, minLength: 1
, stopAdvance: false
, dropup: false
}
$.fn.typeahead.Constructor = Typeahead