From 4a19b00ae54826975737f4e484084168bf658c35 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 10 Mar 2010 11:24:40 -0500 Subject: [PATCH] Rename init() to reset() and implement a new init() method that actually initializes the object --- horde/js/prettyautocomplete.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/horde/js/prettyautocomplete.js b/horde/js/prettyautocomplete.js index d445a648f..026c9aae5 100644 --- a/horde/js/prettyautocomplete.js +++ b/horde/js/prettyautocomplete.js @@ -28,7 +28,15 @@ var PrettyAutocompleter = Class.create({ // the borderless input field located in p.box this.p.items = element; this.p.trigger = element + 'real'; + this.initialized = false; + }, + /** + * Initialize the autocompleter, build the dom structure, register + * events, etc... + */ + init: function() + { // Build the DOM structure this.buildStructure(); @@ -65,9 +73,15 @@ var PrettyAutocompleter = Class.create({ if (typeof this.p.existing != 'undefined') { this.init(this.p.existing); } + + this.initialized = true; }, - init: function(existing) + /** + * Reset the autocompleter's state + * + */ + reset: function(existing) { // TODO: Resize the trigger field to fill the current line? // Clear any existing values -- 2.11.0