Prompts for SimpleAutocomplete

master
Vitaliy Filippov 10 years ago
parent ca551aaf8e
commit 79f6f68ebc
  1. 6
      hinter.js

@ -46,6 +46,9 @@
If emptyText === false, the hint will be hidden instead of showing text.
allowHTML
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
If this is set to a non-zero value, the autocompleter does no more than
1 request in each delay milliseconds.
@ -76,6 +79,7 @@ var SimpleAutocomplete = function(input, dataLoader, params)
this.maxHeight = params.maxHeight;
this.emptyText = params.emptyText;
this.allowHTML = params.allowHTML;
this.promptHTML = params.promptHTML || '';
this.delay = params.delay;
this.moreMarker = params.moreMarker;
@ -157,7 +161,7 @@ SimpleAutocomplete.prototype.init = function()
// obj = [ [ name, value, disabled ], [ name, value ], ... ]
SimpleAutocomplete.prototype.replaceItems = function(items, keepPosition)
{
this.hintLayer.innerHTML = '';
this.hintLayer.innerHTML = this.promptHTML;
if (!keepPosition)
{
this.hintLayer.scrollTop = 0;

Loading…
Cancel
Save