From 9c9a2d731fea9679f65904a3a6b72dd78b4253a4 Mon Sep 17 00:00:00 2001 From: wei <> Date: Mon, 9 Jan 2006 03:40:59 +0000 Subject: Update library --- framework/Web/Javascripts/base/controls.js | 31 ++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'framework/Web/Javascripts/base/controls.js') diff --git a/framework/Web/Javascripts/base/controls.js b/framework/Web/Javascripts/base/controls.js index 6cb908ed..ad5b8abe 100644 --- a/framework/Web/Javascripts/base/controls.js +++ b/framework/Web/Javascripts/base/controls.js @@ -140,8 +140,9 @@ Prado.ActivePanel.Request.prototype = { if(this.options.update) { - var element = $(this.options.update) - if(element) element.innerHTML = output; + if (!this.options.evalScripts) + output = output.stripScripts(); + Element.update(this.options.update, output); } } } @@ -160,7 +161,7 @@ Prado.DropContainer.prototype = Object.extend(new Prado.ActivePanel.Request(), { onDrop : this.onDrop.bind(this), evalScripts : true, - onSuccess : options.onSuccess || this.update.bind(this) + onSuccess : options.onSuccess || this.onSuccess.bind(this) }); Droppables.add(element, this.options); }, @@ -168,12 +169,26 @@ Prado.DropContainer.prototype = Object.extend(new Prado.ActivePanel.Request(), onDrop : function(draggable, droppable) { this.callback(draggable.id) + } +}); + +Prado.ActiveImageButton = Class.create(); +Prado.ActiveImageButton.prototype = +{ + initialize : function(element, options) + { + this.element = $(element); + this.options = options; + Event.observe(this.element, "click", this.click.bind(this)); }, - update : function(result, output) + click : function(e) { - this.onSuccess(result, output); - if (this.options.evalScripts) - Prado.AJAX.EvalScript(output); + var el = $('{$this->ClientID}'); + var imagePos = Position.cumulativeOffset(this.element); + var clickedPos = [e.clientX, e.clientY]; + var param = (clickedPos[0]-imagePos[0]+1)+","+(clickedPos[1]-imagePos[1]+1); + Prado.Callback(this.element, param, null, this.options); + Event.stop(e); } -}); \ No newline at end of file +} \ No newline at end of file -- cgit v1.2.3