summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/base/controls.js
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/base/controls.js')
-rw-r--r--framework/Web/Javascripts/base/controls.js31
1 files changed, 23 insertions, 8 deletions
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