diff --git a/hinter.js b/hinter.js index a6c4bc0..0f6ad67 100644 --- a/hinter.js +++ b/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;