diff options
author | wei <> | 2005-12-13 07:08:30 +0000 |
---|---|---|
committer | wei <> | 2005-12-13 07:08:30 +0000 |
commit | 35c7ff28cbc311fba5e394b11fb756a4dc1edcb9 (patch) | |
tree | 1ee39944b4cdba1ecc6aeb2a952139b5a3165f67 /framework/Web/Javascripts/base | |
parent | 2c383b6050b3d8cc6ac7a9442c999cb903af43ab (diff) |
Removed inline javascript from components. Adding TJavascriptLogger and logger.js
Diffstat (limited to 'framework/Web/Javascripts/base')
-rw-r--r-- | framework/Web/Javascripts/base/prado.js | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/framework/Web/Javascripts/base/prado.js b/framework/Web/Javascripts/base/prado.js index 2174908f..3eded927 100644 --- a/framework/Web/Javascripts/base/prado.js +++ b/framework/Web/Javascripts/base/prado.js @@ -25,26 +25,41 @@ Prado.Button.fireButton = function(event, target) Prado.TextBox = Class.create();
-Prado.TextBox.handleReturnKey = function(event)
+/**
+ * Returns FALSE when the "Enter" key is pressed AND when onchange
+ * property is defined. The onchange function is called. However,
+ * it does not call event listener functions.
+ * @return boolean false if "Enter" and onchange property is defined, true otherwise.
+ */
+Prado.TextBox.handleReturnKey = function(ev)
{
- if (event.keyCode == 13)
+ var kc = ev.keyCode != null ? ev.keyCode : ev.charCode;
+ if(kc == Event.KEY_RETURN)
{
- 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))
+ var target = Event.element(ev);
+ if(target && isFunction(target.onchange))
{
- if(typeof(target.onchange)!="undefined")
- {
- target.onchange();
- event.cancelBubble=true;
- if(event.stopPropagation)
- event.stopPropagation();
- return false;
- }
+ target.onchange();
+ Event.stop(ev);
+ return false;
}
}
return true;
-}
\ No newline at end of file +}
+
+/**
+ * Creates a LinkButton and register the post back to the onclick event.
+ */
+/* to finish when doPostback changes
+Prado.LinkButton = Class.create();
+Prado.LinkButton.prototype =
+{
+ initialize : function(element, name)
+ {
+ Event.observe(element, 'click', function(e)
+ {
+ Prado.doPostback(element, name, '');
+ Event.stop(e);
+ });
+ }
+}*/
\ No newline at end of file |