Skip to content

Commit

Permalink
[jan] Allow to use the pretty autocompleter without Ajax requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jul 13, 2016
1 parent 6fa76d7 commit 99190aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
21 changes: 12 additions & 9 deletions framework/Core/js/prettyautocomplete.js
Expand Up @@ -91,15 +91,17 @@ var PrettyAutocompleter = Class.create({
this.input.observe('keyup', this.resize.bind(this));
this.input.observe('keydown', this.keyDownHandler.bindAsEventListener(this));

// Create the underlaying Autocompleter
this.p.uri += '&input=' + this.p.trigger;
if (this.p.uri) {
// Create the underlaying Autocompleter
this.p.uri += '&input=' + this.p.trigger;

this.p.onShow = this.knlShow.bind(this);
this.p.onHide = this.knlHide.bind(this);
this.p.onShow = this.knlShow.bind(this);
this.p.onHide = this.knlHide.bind(this);

// Make sure the knl is contained in the overlay
this.p.domParent = this.p.box;
this.aac = new Ajax.Autocompleter(this.p.trigger, this.p.uri, this.p);
// Make sure the knl is contained in the overlay
this.p.domParent = this.p.box;
this.aac = new Ajax.Autocompleter(this.p.trigger, this.p.uri, this.p);
}
this.initialized = true;

// Prepopulate the items and the container elements?
Expand Down Expand Up @@ -305,8 +307,9 @@ var PrettyAutocompleter = Class.create({

honorReturn: function()
{
return (this.aac.knl && !this.aac.knl.getCurrentEntry()) ||
!this.aac.knl;
return this.aac &&
((this.aac.knl && !this.aac.knl.getCurrentEntry()) ||
!this.aac.knl);
},

clickHandler: function(e)
Expand Down
6 changes: 4 additions & 2 deletions framework/Core/package.xml
Expand Up @@ -28,7 +28,7 @@
<email>mrubinsk@horde.org</email>
<active>yes</active>
</developer>
<date>2016-07-12</date>
<date>2016-07-13</date>
<version>
<release>2.25.0</release>
<api>2.25.0</api>
Expand All @@ -39,6 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Allow to use the pretty autocompleter without Ajax requests.
* [mjr] Allow adding CSS files with Ajax response.
* [mjr] Use syntaxhighlighter version 4.
* [jan] Fix issue with prototype.js that keeps images in HTML messages from loading.
Expand Down Expand Up @@ -4198,9 +4199,10 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2016-07-12</date>
<date>2016-07-13</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Allow to use the pretty autocompleter without Ajax requests.
* [mjr] Allow adding CSS files with Ajax response.
* [mjr] Use syntaxhighlighter version 4.
* [jan] Fix issue with prototype.js that keeps images in HTML messages from loading.
Expand Down

0 comments on commit 99190aa

Please sign in to comment.