summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/base/controls.js
diff options
context:
space:
mode:
authorwei <>2006-01-09 03:40:59 +0000
committerwei <>2006-01-09 03:40:59 +0000
commit9c9a2d731fea9679f65904a3a6b72dd78b4253a4 (patch)
tree1d81a12a7a79e74e98218d01c6278a81f0996f5d /framework/Web/Javascripts/base/controls.js
parent10420d2bcde1a7437b58175f417170b2d6d93e50 (diff)
Update library
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