summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/base/prado.js36
-rw-r--r--framework/Web/Javascripts/js/base.js34
2 files changed, 60 insertions, 10 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
diff --git a/framework/Web/Javascripts/js/base.js b/framework/Web/Javascripts/js/base.js
index 1f86b1c1..276c17bd 100644
--- a/framework/Web/Javascripts/js/base.js
+++ b/framework/Web/Javascripts/js/base.js
@@ -841,13 +841,13 @@ return _7;
Prado=Class.create();
Prado.version="3.0a";
-Prado.DefaultButton=Class.create();
-Prado.DefaultButton.buttonFired=false;
-Prado.DefaultButton.fire=function(_1,_2){
-if(!Prado.DefaultButton.buttonFired&&_1.keyCode==13&&!(_1.srcElement&&(_1.srcElement.tagName.toLowerCase()=="textarea"))){
+Prado.Button=Class.create();
+Prado.Button.buttonFired=false;
+Prado.Button.fireButton=function(_1,_2){
+if(!Prado.Button.buttonFired&&_1.keyCode==13&&!(_1.srcElement&&(_1.srcElement.tagName.toLowerCase()=="textarea"))){
var _3=document.getElementById?document.getElementById(_2):document.all[_2];
if(_3&&typeof (_3.click)!="undefined"){
-Prado.DefaultButton.buttonFired=true;
+Prado.Button.buttonFired=true;
_3.click();
_1.cancelBubble=true;
if(_1.stopPropagation){
@@ -858,6 +858,30 @@ return false;
}
return true;
};
+Prado.TextBox=Class.create();
+Prado.TextBox.handleReturnKey=function(_4){
+if(_4.keyCode==13){
+var _5;
+if(typeof (_4.target)!="undefined"){
+_5=_4.target;
+}else{
+if(typeof (_4.srcElement)!="undefined"){
+_5=_4.srcElement;
+}
+}
+if((typeof (_5)!="undefined")&&(_5!=null)){
+if(typeof (_5.onchange)!="undefined"){
+_5.onchange();
+_4.cancelBubble=true;
+if(_4.stopPropagation){
+_4.stopPropagation();
+}
+return false;
+}
+}
+}
+return true;
+};
Prado.doPostBack=function(_1,_2,_3,_4,_5,_6,_7,_8){
if(typeof (_4)=="undefined"){