Skip to content

Commit

Permalink
Fix regression.
Browse files Browse the repository at this point in the history
The element might not yet exist while calling the constructor.
  • Loading branch information
yunosh committed Jun 13, 2014
1 parent 5965fec commit d687c78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions framework/Core/js/prettyautocomplete.js
Expand Up @@ -48,7 +48,7 @@ var PrettyAutocompleter = Class.create({
// The original input element is transformed into the hidden input
// field that hold the text values (this.elm), while p.trigger is
// the borderless input field located in p.box
this.elm = $(element);
this.elm = element;
this.p.trigger = element + 'real';
this.initialized = false;
this.enabled = true;
Expand All @@ -69,7 +69,7 @@ var PrettyAutocompleter = Class.create({

// Make sure the original input box element is hidden
if (!this.p.debug) {
this.elm.hide();
$(this.elm).hide();
}

// Set the updateElement callback to pass to the Autocompleter.
Expand Down Expand Up @@ -150,7 +150,7 @@ var PrettyAutocompleter = Class.create({
// Replace the single input element with the new structure and
// move the old element into the structure while making sure it's
// hidden. (Use the long form to play nice with Opera)
this.box.insert(Element.replace(this.elm, this.box));
this.box.insert(Element.replace($(this.elm), this.box));
},

processValue: function()
Expand Down Expand Up @@ -241,7 +241,7 @@ var PrettyAutocompleter = Class.create({

updateHiddenInput: function()
{
this.elm.setValue(this.currentValues().join(', '));
$(this.elm).setValue(this.currentValues().join(', '));
},

currentEntries: function()
Expand Down

0 comments on commit d687c78

Please sign in to comment.