From: Michael J. Rubinsky Date: Wed, 10 Mar 2010 16:24:40 +0000 (-0500) Subject: Rename init() to reset() and implement a new init() method that actually initializes... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4a19b00ae54826975737f4e484084168bf658c35;p=horde.git Rename init() to reset() and implement a new init() method that actually initializes the object --- 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