From 03dbe16b7762cc1a9e57df4e9e34bc04f46bb57f Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 3 Apr 2007 01:38:15 +0000 Subject: update js onclick handler context for controls with js counterpart. --- framework/Web/Javascripts/js/compressed/prado.js | 2 +- framework/Web/Javascripts/js/debug/prado.js | 2 +- framework/Web/Javascripts/prado/controls/controls.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/Javascripts/js/compressed/prado.js b/framework/Web/Javascripts/js/compressed/prado.js index 55651927..7c2c3ea6 100644 --- a/framework/Web/Javascripts/js/compressed/prado.js +++ b/framework/Web/Javascripts/js/compressed/prado.js @@ -462,7 +462,7 @@ var newdate=new Date(year,month-1,date,0,0,0);return newdate;}});Prado.WebUI=Cla {if(this.onInit) this.onInit(options);}},onInit:function(options) {if(typeof(this.element.onclick)=="function") -{this._elementOnClick=this.element.onclick;this.element.onclick=null;} +{this._elementOnClick=this.element.onclick.bind(this.element);;this.element.onclick=null;} Event.observe(this.element,"click",this.elementClicked.bindEvent(this,options));},elementClicked:function(event,options) {var src=Event.element(event);var doPostBack=true;var onclicked=null;if(this._elementOnClick) {var onclicked=this._elementOnClick(event);if(typeof(onclicked)=="boolean") diff --git a/framework/Web/Javascripts/js/debug/prado.js b/framework/Web/Javascripts/js/debug/prado.js index d1a04f4f..03c271af 100644 --- a/framework/Web/Javascripts/js/debug/prado.js +++ b/framework/Web/Javascripts/js/debug/prado.js @@ -4447,7 +4447,7 @@ Prado.WebUI.PostBackControl.prototype = { if(typeof(this.element.onclick)=="function") { - this._elementOnClick = this.element.onclick; + this._elementOnClick = this.element.onclick.bind(this.element);; this.element.onclick = null; } Event.observe(this.element, "click", this.elementClicked.bindEvent(this,options)); diff --git a/framework/Web/Javascripts/prado/controls/controls.js b/framework/Web/Javascripts/prado/controls/controls.js index 64fb1a30..ff40b0e8 100644 --- a/framework/Web/Javascripts/prado/controls/controls.js +++ b/framework/Web/Javascripts/prado/controls/controls.js @@ -20,7 +20,7 @@ Prado.WebUI.PostBackControl.prototype = { if(typeof(this.element.onclick)=="function") { - this._elementOnClick = this.element.onclick; + this._elementOnClick = this.element.onclick.bind(this.element); this.element.onclick = null; } Event.observe(this.element, "click", this.elementClicked.bindEvent(this,options)); -- cgit v1.2.3