mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
fix typeahead menu
This commit is contained in:
parent
929ceb91e4
commit
f06267dd0b
|
@ -16,6 +16,7 @@
|
|||
- set default language in login form if language selector is turned off
|
||||
- do not show full list of notifiers to none admins
|
||||
- do not list document/folders in sequence selector if its number exceeds 50
|
||||
- typeahead menu works with arrow keys again, wait 1 sec. before searching
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.33
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
this.source = this.options.source
|
||||
this.$menu = $(this.options.menu)
|
||||
this.shown = false
|
||||
this.timeout = null
|
||||
this.listen()
|
||||
}
|
||||
|
||||
|
@ -254,7 +255,11 @@
|
|||
break
|
||||
|
||||
default:
|
||||
clearTimeout(this.timeout);
|
||||
|
||||
this.timeout = setTimeout(() => {
|
||||
this.lookup()
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
|
|
|
@ -93,8 +93,8 @@ function initMost() {
|
|||
* for each hit and render could only process strings.
|
||||
* */
|
||||
$("#searchfield").typeahead({ /* {{{ */
|
||||
menu: '<div class="typeahead dropdown-menu"></div>',
|
||||
item: '<li><a class="dropdown-item" href="#"></a></li>',
|
||||
menu: '<div class="typeahead dropdown-menu" style="max-height: 500px; overflow-y: auto;"></div>',
|
||||
item: '<a class="dropdown-item" href="#"></a>',
|
||||
minLength: 3,
|
||||
items: 100, /* the query will limit the number of hits */
|
||||
source: function(query, process) {
|
||||
|
@ -170,7 +170,8 @@ function initMost() {
|
|||
|
||||
items = $(items).map(function (i, item) {
|
||||
i = $(that.options.item).attr('data-value', item.name).attr('data-id', item.id).attr('data-type', item.type);
|
||||
i.find('a').html(that.highlighter(item))
|
||||
/* i is already the 'a' tag, there is no 'li' as used by bootstrap 2 */
|
||||
i./*find('a').*/html(that.highlighter(item))
|
||||
return i[0]
|
||||
})
|
||||
|
||||
|
@ -184,7 +185,7 @@ function initMost() {
|
|||
/* Document chooser */
|
||||
$("[id^=choosedocsearch]").typeahead({ /* {{{ */
|
||||
menu: '<div class="typeahead dropdown-menu"></div>',
|
||||
item: '<li><a class="dropdown-item" href="#"></a></li>',
|
||||
item: '<a class="dropdown-item" href="#"></a>',
|
||||
minLength: 3,
|
||||
source: function(query, process) {
|
||||
// console.log(this.options);
|
||||
|
@ -222,7 +223,7 @@ function initMost() {
|
|||
|
||||
items = $(items).map(function (i, item) {
|
||||
i = $(that.options.item).attr('data-value', item.name).attr('data-id', item.id).attr('data-type', item.type);
|
||||
i.find('a').html(that.highlighter(item))
|
||||
i./*find('a').*/html(that.highlighter(item))
|
||||
return i[0]
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user