summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web')
-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)