mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
improve navigating in typeahead menu
This commit is contained in:
parent
da664f2948
commit
f4a44a853f
|
@ -157,10 +157,13 @@
|
|||
, next = active.next()
|
||||
|
||||
if (!next.length) {
|
||||
next = $(this.$menu.find('li')[0])
|
||||
next = $(this.$menu.find(this.options.itemtag)[0])
|
||||
}
|
||||
|
||||
next.addClass('active')
|
||||
var index = this.$menu.children().index(next)
|
||||
var r = this.$menu.height()/next.height()-1;
|
||||
this.$menu.scrollTop(this.$menu.scrollTop()+next.offset().top-50-index*r)
|
||||
}
|
||||
|
||||
, prev: function (event) {
|
||||
|
@ -168,10 +171,13 @@
|
|||
, prev = active.prev()
|
||||
|
||||
if (!prev.length) {
|
||||
prev = this.$menu.find('li').last()
|
||||
prev = this.$menu.find(this.options.itemtag).last()
|
||||
}
|
||||
|
||||
prev.addClass('active')
|
||||
var index = this.$menu.children().index(prev)
|
||||
var r = this.$menu.height()/prev.height()-1;
|
||||
this.$menu.scrollTop(this.$menu.scrollTop()+prev.offset().top-50-index*r)
|
||||
}
|
||||
|
||||
, listen: function () {
|
||||
|
|
Loading…
Reference in New Issue
Block a user