summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorwei <>2006-05-05 03:21:33 +0000
committerwei <>2006-05-05 03:21:33 +0000
commitbeeb00efbeb2ea5925285c68e4f9a9f680b0ffdc (patch)
treef2f1b7a640d7b4a49cec389ea1ac84b0b638e788 /framework
parent05b69a565ebf001f42fdb6558f204bf3f1a9b61a (diff)
Fixed #156.
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/Javascripts/js/prado.js7
-rw-r--r--framework/Web/Javascripts/prado/element.js17
2 files changed, 4 insertions, 20 deletions
diff --git a/framework/Web/Javascripts/js/prado.js b/framework/Web/Javascripts/js/prado.js
index 498a6cf7..56364428 100644
--- a/framework/Web/Javascripts/js/prado.js
+++ b/framework/Web/Javascripts/js/prado.js
@@ -253,11 +253,8 @@ Prado.Element={setValue:function(element,value)
el.value=value;},select:function(element,method,value)
{var el=$(element);var isList=element.indexOf('[]')>-1;if(!el&&!isList)return;method=isList?'check'+method:el.tagName.toLowerCase()+method;var selection=Prado.Element.Selection;if(isFunction(selection[method]))
selection[method](isList?element:el,value);},click:function(element)
-{var el=$(element);if(!el)return;if(document.createEvent)
-{var evt=document.createEvent('HTMLEvents');evt.initEvent('click',true,true);el.dispatchEvent(evt);}
-else if(el.fireEvent)
-{el.fireEvent('onclick');if(typeof(el.onclick)=="function")
-el.onclick();}},setAttribute:function(element,attribute,value)
+{var el=$(element);if(el)
+Event.fireEvent(el,'click');},setAttribute:function(element,attribute,value)
{var el=$(element);if(attribute=="disabled"&&value==false)
el.removeAttribute(attribute);else
el.setAttribute(attribute,value);},setOptions:function(element,options)
diff --git a/framework/Web/Javascripts/prado/element.js b/framework/Web/Javascripts/prado/element.js
index 06937253..0d9c74d1 100644
--- a/framework/Web/Javascripts/prado/element.js
+++ b/framework/Web/Javascripts/prado/element.js
@@ -26,21 +26,8 @@ Prado.Element =
click : function(element)
{
var el = $(element);
- //Logger.info(el);
- if(!el) return;
- if(document.createEvent)
- {
- var evt = document.createEvent('HTMLEvents');
- evt.initEvent('click', true, true);
- el.dispatchEvent(evt);
- //Logger.warn("dispatching click for "+el.id);
- }
- else if(el.fireEvent)
- {
- el.fireEvent('onclick');
- if(typeof(el.onclick) == "function")
- el.onclick();
- }
+ if(el)
+ Event.fireEvent(el,'click');
},
setAttribute : function(element, attribute, value)