Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2024-04-02 09:07:16 +02:00
commit 038e929778
3 changed files with 10 additions and 3 deletions

View File

@ -157,10 +157,13 @@
, next = active.next() , next = active.next()
if (!next.length) { if (!next.length) {
next = $(this.$menu.find('li')[0]) next = $(this.$menu.find(this.options.itemtag)[0])
} }
next.addClass('active') 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) { , prev: function (event) {
@ -168,10 +171,13 @@
, prev = active.prev() , prev = active.prev()
if (!prev.length) { if (!prev.length) {
prev = this.$menu.find('li').last() prev = this.$menu.find(this.options.itemtag).last()
} }
prev.addClass('active') 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 () { , listen: function () {

View File

@ -90,6 +90,7 @@ function initMost() {
* for each hit and render could only process strings. * for each hit and render could only process strings.
* */ * */
$("#searchfield").typeahead({ /* {{{ */ $("#searchfield").typeahead({ /* {{{ */
menu: '<ul class="typeahead dropdown-menu" style="max-height: 600px; overflow-y: auto;"></ul>',
minLength: 3, minLength: 3,
items: 100, /* the query will limit the number of hits */ items: 100, /* the query will limit the number of hits */
source: function(query, process) { source: function(query, process) {

View File

@ -93,7 +93,7 @@ function initMost() {
* for each hit and render could only process strings. * for each hit and render could only process strings.
* */ * */
$("#searchfield").typeahead({ /* {{{ */ $("#searchfield").typeahead({ /* {{{ */
menu: '<div class="typeahead dropdown-menu" style="max-height: 500px; overflow-y: auto;"></div>', menu: '<div class="typeahead dropdown-menu" style="max-height: 600px; overflow-y: auto;"></div>',
item: '<a class="dropdown-item" href="#"></a>', item: '<a class="dropdown-item" href="#"></a>',
itemtag: 'a', itemtag: 'a',
minLength: 3, minLength: 3,