mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 17:00:10 +00:00
fix for heading space in search box (#4868)
This commit is contained in:
parent
4bb913884a
commit
9bd7d2dd3c
3 changed files with 6 additions and 9 deletions
11
httpdocs/js/bootstrap3-typeahead.js
vendored
11
httpdocs/js/bootstrap3-typeahead.js
vendored
|
|
@ -158,12 +158,9 @@
|
|||
if (typeof(query) != 'undefined' && query !== null) {
|
||||
this.query = query;
|
||||
} else {
|
||||
this.query = this.$element.val() || this.$element.text() || '';
|
||||
this.query = this.$element.val().trim() || this.$element.text().trim() || '';
|
||||
}
|
||||
|
||||
// trim spaces
|
||||
this.query.trim();
|
||||
|
||||
if (this.query.length < this.options.minLength && !this.options.showHintOnFocus) {
|
||||
return this.shown ? this.hide() : this;
|
||||
}
|
||||
|
|
@ -420,8 +417,8 @@
|
|||
// prevent spacing at the start
|
||||
let currentValue = this.$element.val() || this.$element.text();
|
||||
currentValue = currentValue.trim();
|
||||
|
||||
if (e.keyCode == 32 && currentValue === "") {
|
||||
|
||||
if (e.keyCode == 32 && currentValue === "" || e.keyCode === 32 && e.target.selectionStart == 0) {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
|
@ -465,13 +462,13 @@
|
|||
if (!this.shown) return;
|
||||
this.select();
|
||||
break;
|
||||
|
||||
case 27: // escape
|
||||
if (!this.shown) return;
|
||||
this.hide();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue