summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/base/prado.js
diff options
context:
space:
mode:
authorxue <>2005-12-07 03:31:08 +0000
committerxue <>2005-12-07 03:31:08 +0000
commitd2f675e58b1c42c8960907ee20490a391aec0ecc (patch)
treeec37e7019b5ea261b4dde1ac88b2dacbd0675905 /framework/Web/Javascripts/base/prado.js
parentbd56fe6028fc09d8121f353ac7e33fc11994de9b (diff)
Diffstat (limited to 'framework/Web/Javascripts/base/prado.js')
-rw-r--r--framework/Web/Javascripts/base/prado.js36
1 files changed, 31 insertions, 5 deletions
diff --git a/framework/Web/Javascripts/base/prado.js b/framework/Web/Javascripts/base/prado.js
index b1e87634..2174908f 100644
--- a/framework/Web/Javascripts/base/prado.js
+++ b/framework/Web/Javascripts/base/prado.js
@@ -2,17 +2,17 @@ Prado = Class.create();
Prado.version = '3.0a';
-Prado.DefaultButton = Class.create();
+Prado.Button = Class.create();
-Prado.DefaultButton.buttonFired = false;
-Prado.DefaultButton.fire = function(event, target)
+Prado.Button.buttonFired = false;
+Prado.Button.fireButton = function(event, target)
{
- if (!Prado.DefaultButton.buttonFired && event.keyCode == 13 && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea")))
+ if (!Prado.Button.buttonFired && event.keyCode == 13 && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea")))
{
var defaultButton = document.getElementById ? document.getElementById(target) : document.all[target];
if (defaultButton && typeof(defaultButton.click) != "undefined")
{
- Prado.DefaultButton.buttonFired = true;
+ Prado.Button.buttonFired = true;
defaultButton.click();
event.cancelBubble = true;
if (event.stopPropagation)
@@ -22,3 +22,29 @@ Prado.DefaultButton.fire = function(event, target)
}
return true;
}
+
+Prado.TextBox = Class.create();
+
+Prado.TextBox.handleReturnKey = function(event)
+{
+ if (event.keyCode == 13)
+ {
+ var target;
+ if(typeof(event.target)!="undefined")
+ target=event.target;
+ else if(typeof(event.srcElement)!="undefined")
+ target=event.srcElement;
+ if((typeof(target)!="undefined") && (target!=null))
+ {
+ if(typeof(target.onchange)!="undefined")
+ {
+ target.onchange();
+ event.cancelBubble=true;
+ if(event.stopPropagation)
+ event.stopPropagation();
+ return false;
+ }
+ }
+ }
+ return true;
+} \ No newline at end of file