summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/js/compressed/ajax.js
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/js/compressed/ajax.js')
-rw-r--r--framework/Web/Javascripts/js/compressed/ajax.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/framework/Web/Javascripts/js/compressed/ajax.js b/framework/Web/Javascripts/js/compressed/ajax.js
index c1ce7504..cc967514 100644
--- a/framework/Web/Javascripts/js/compressed/ajax.js
+++ b/framework/Web/Javascripts/js/compressed/ajax.js
@@ -224,14 +224,19 @@ Event.stop(event);}});Prado.WebUI.TActiveRadioButton=Class.extend(Prado.WebUI.TA
Event.observe(this.element,"keydown",this.handleReturnKey.bind(this));if(this.options['AutoPostBack']==true)
Event.observe(this.element,"change",this.doCallback.bindEvent(this,options));},doCallback:function(event,options)
{var request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();Event.stop(event);}});Prado.WebUI.TAutoComplete=Class.extend(Autocompleter.Base,Prado.WebUI.TActiveTextBox.prototype);Prado.WebUI.TAutoComplete=Class.extend(Prado.WebUI.TAutoComplete,{initialize:function(options)
-{this.options=options;this.baseInitialize(options.ID,options.ResultPanel,options);Object.extend(this.options,{onSuccess:this.onComplete.bind(this)});if(options.AutoPostBack)
+{this.options=options;this.hasResults=false;this.baseInitialize(options.ID,options.ResultPanel,options);Object.extend(this.options,{onSuccess:this.onComplete.bind(this)});if(options.AutoPostBack)
this.onInit(options);},doCallback:function(event,options)
{if(!this.active)
{var request=new Prado.CallbackRequest(this.options.EventTarget,options);request.dispatch();Event.stop(event);}},onClick:function(event)
{var element=Event.findElement(event,'LI');this.index=element.autocompleteIndex;this.selectEntry();this.hide();Event.fireEvent(this.element,"change");},getUpdatedChoices:function()
-{var options=new Array(this.getToken(),"__TAutoComplete_onSuggest__");Prado.Callback(this.options.EventTarget,options,null,this.options);},onComplete:function(request,boundary)
-{var result=Prado.Element.extractContent(request.transport.responseText,boundary);if(typeof(result)=="string"&&result.length>0)
-this.updateChoices(result);}});Prado.WebUI.TTimeTriggeredCallback=Base.extend({constructor:function(options)
+{var options=new Array(this.getToken(),"__TAutoComplete_onSuggest__");Prado.Callback(this.options.EventTarget,options,null,this.options);},selectEntry:function()
+{if(this.hasResults)
+{this.active=false;this.updateElement(this.getCurrentEntry());}},onComplete:function(request,boundary)
+{var result=Prado.Element.extractContent(request.transport.responseText,boundary);if(typeof(result)=="string")
+{if(result.length>0)
+{this.hasResults=true;this.updateChoices(result);}
+else
+{this.active=false;this.hasResults=false;this.hide();}}},});Prado.WebUI.TTimeTriggeredCallback=Base.extend({constructor:function(options)
{this.options=Object.extend({Interval:1},options||{});Prado.WebUI.TTimeTriggeredCallback.register(this);},startTimer:function()
{setTimeout(this.onTimerEvent.bind(this),100);if(typeof(this.timer)=='undefined'||this.timer==null)
this.timer=setInterval(this.onTimerEvent.bind(this),this.options.Interval*1000);},stopTimer:function()