Prompts for SimpleAutocomplete
parent
ca551aaf8e
commit
79f6f68ebc
|
@ -46,6 +46,9 @@
|
||||||
If emptyText === false, the hint will be hidden instead of showing text.
|
If emptyText === false, the hint will be hidden instead of showing text.
|
||||||
allowHTML
|
allowHTML
|
||||||
If true, HTML code will be allowed in option names.
|
If true, HTML code will be allowed in option names.
|
||||||
|
promptHTML
|
||||||
|
The HTML code to be displayed before the option list ("input prompt").
|
||||||
|
Empty by default.
|
||||||
delay
|
delay
|
||||||
If this is set to a non-zero value, the autocompleter does no more than
|
If this is set to a non-zero value, the autocompleter does no more than
|
||||||
1 request in each delay milliseconds.
|
1 request in each delay milliseconds.
|
||||||
|
@ -76,6 +79,7 @@ var SimpleAutocomplete = function(input, dataLoader, params)
|
||||||
this.maxHeight = params.maxHeight;
|
this.maxHeight = params.maxHeight;
|
||||||
this.emptyText = params.emptyText;
|
this.emptyText = params.emptyText;
|
||||||
this.allowHTML = params.allowHTML;
|
this.allowHTML = params.allowHTML;
|
||||||
|
this.promptHTML = params.promptHTML || '';
|
||||||
this.delay = params.delay;
|
this.delay = params.delay;
|
||||||
this.moreMarker = params.moreMarker;
|
this.moreMarker = params.moreMarker;
|
||||||
|
|
||||||
|
@ -157,7 +161,7 @@ SimpleAutocomplete.prototype.init = function()
|
||||||
// obj = [ [ name, value, disabled ], [ name, value ], ... ]
|
// obj = [ [ name, value, disabled ], [ name, value ], ... ]
|
||||||
SimpleAutocomplete.prototype.replaceItems = function(items, keepPosition)
|
SimpleAutocomplete.prototype.replaceItems = function(items, keepPosition)
|
||||||
{
|
{
|
||||||
this.hintLayer.innerHTML = '';
|
this.hintLayer.innerHTML = this.promptHTML;
|
||||||
if (!keepPosition)
|
if (!keepPosition)
|
||||||
{
|
{
|
||||||
this.hintLayer.scrollTop = 0;
|
this.hintLayer.scrollTop = 0;
|
||||||
|
|
Loading…
Reference in New Issue