--- Revision 568 +++ Revision 569 @@ -67,6 +67,9 @@ // Close button var close = new Element('a', {'href': '#', 'class': 'closebutton'}); li.insert(new Element("span").update(text).insert(close)); + if (value) + li.writeAttribute("pui-autocomplete:value", value); + close.observe("click", this.remove.bind(this, li)); this.input.parentNode.insert({before: li}); @@ -144,7 +147,7 @@ if (!element) this.input.blur(); -// this.hideAutocomplete(); + this.hideAutocomplete(); return this.fire("element:blur", {element: element}); }, @@ -294,6 +297,7 @@ runRequest: function(search) { this.autocompletionContainer.hide(); this.fire("request:started"); + new Ajax.Request(this.options.url, {parameters: {search: search, max: this.options.max.selection}, onComplete: function(transport) { this.setAutocompleteList(transport.responseText.evalJSON()); this.timer = null; @@ -424,7 +428,7 @@ this.selectedList.each(function(entry) { var li = new Element("li").update(this.options.highlight ? entry.text.gsub(value, "" + value + "") : entry.text); li.observe("mouseover", this.moveSelection.bindAsEventListener(this, li)) - .observe("mousedown", this.addCurrentSelected.bindAsEventListener(this)); + .observe("mousedown", this.addCurrentSelected.bindAsEventListener(this)); this.autocompletionContainer.insert(li); }.bind(this)); this.autocompletionContainer.show();