summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/js/debug
diff options
context:
space:
mode:
authorwei <>2007-03-31 11:35:00 +0000
committerwei <>2007-03-31 11:35:00 +0000
commit2d32c6aa8f682771839531537334250cf4a731bc (patch)
tree89d702f64773e5b441e22bd418086e3bccdb98a3 /framework/Web/Javascripts/js/debug
parentc619ade9b79afdbc176bba6180a37970cd4343e2 (diff)
add inplacetext onkeypress suggestions
Diffstat (limited to 'framework/Web/Javascripts/js/debug')
-rw-r--r--framework/Web/Javascripts/js/debug/ajax.js30
1 files changed, 25 insertions, 5 deletions
diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js
index 936f50e4..5b36b2d1 100644
--- a/framework/Web/Javascripts/js/debug/ajax.js
+++ b/framework/Web/Javascripts/js/debug/ajax.js
@@ -2024,6 +2024,8 @@ Prado.WebUI.TAutoComplete = Class.extend(Prado.WebUI.TAutoComplete,
{
this.active = false;
this.updateElement(this.getCurrentEntry());
+ var options = [this.index, "__TAutoComplete_onSuggestionSelected__"];
+ Prado.Callback(this.options.EventTarget, options, null, this.options);
}
},
@@ -2239,12 +2241,13 @@ Prado.WebUI.TValueTriggeredCallback = Base.extend(
Prado.WebUI.TInPlaceTextBox = Base.extend(
{
- isSaving : false,
- isEditing : false,
- editField : null,
-
constructor : function(options)
{
+
+ this.isSaving = false;
+ this.isEditing = false;
+ this.editField = null;
+
this.options = Object.extend(
{
LoadTextFromSource : false,
@@ -2379,6 +2382,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
}
Event.observe(this.editField, "blur", this.onTextBoxBlur.bind(this));
+ Event.observe(this.editField, "keypress", this.onKeyPressed.bind(this));
},
/**
@@ -2402,7 +2406,10 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
{
text = this.element.innerHTML;
if(this.options.AutoPostBack && text != this.editField.value)
- this.onTextChanged(text);
+ {
+ if(this.isEditing)
+ this.onTextChanged(text);
+ }
else
{
this.element.innerHTML = this.editField.value;
@@ -2412,6 +2419,19 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
}
},
+ onKeyPressed : function(e)
+ {
+ if (Event.keyCode(e) == Event.KEY_ESC)
+ {
+ this.editField.value = this.getText();
+ this.isEditing = false;
+ if(this.options.AutoHide)
+ this.showLabel();
+ }
+ else if (Event.keyCode(e) == Event.KEY_RETURN)
+ Event.stop(e);
+ },
+
/**
* When the text input value has changed.
* @param {String} original text