summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/source
diff options
context:
space:
mode:
authortof <>2008-10-13 13:40:34 +0000
committertof <>2008-10-13 13:40:34 +0000
commit303edb1dd308d3812102fbe25438e56413cd79a3 (patch)
tree8c64c73f98b4bb76ecf23df0f952d195b4924026 /framework/Web/Javascripts/source
parent886386efc0ca4b72d1567946061c0eff7cbe45c6 (diff)
Added drag and drop components
Diffstat (limited to 'framework/Web/Javascripts/source')
-rw-r--r--framework/Web/Javascripts/source/packages.php5
-rwxr-xr-xframework/Web/Javascripts/source/prado/activecontrols/dragdrop.js24
2 files changed, 27 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/source/packages.php b/framework/Web/Javascripts/source/packages.php
index 7c0a1674..b19a5d18 100644
--- a/framework/Web/Javascripts/source/packages.php
+++ b/framework/Web/Javascripts/source/packages.php
@@ -47,7 +47,8 @@ $packages = array(
),
'dragdrop'=>array(
- SCRIPTACULOUS_DIR.'/dragdrop.js'
+ SCRIPTACULOUS_DIR.'/dragdrop.js',
+ 'prado/activecontrols/dragdrop.js'
),
'slider'=>array(
@@ -78,7 +79,7 @@ $dependencies = array(
'datepicker' => array('prado', 'datepicker'),
'colorpicker' => array('prado', 'colorpicker'),
'ajax' => array('prado', 'effects', 'ajax'),
- 'dragdrop' => array('prado', 'effects', 'dragdrop'),
+ 'dragdrop' => array('prado', 'effects', 'ajax', 'dragdrop'),
'slider' => array('prado', 'slider'),
'keyboard' => array('prado', 'keyboard'),
'tabpanel' => array('prado', 'tabpanel'),
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js
new file mode 100755
index 00000000..0b42afd5
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js
@@ -0,0 +1,24 @@
+/**
+ * DropContainer control
+ */
+
+Prado.WebUI.DropContainer = Class.extend(Prado.WebUI.CallbackControl);
+
+Object.extend(Prado.WebUI.DropContainer.prototype,
+{
+ initialize: function(options)
+ {
+ this.options = options;
+ Object.extend (this.options,
+ {
+ onDrop: this.onDrop.bind(this)
+ });
+
+ Droppables.add (options.ID, this.options);
+ },
+
+ onDrop: function(dragElement, dropElement)
+ {
+ Prado.Callback(this.options.EventTarget, dragElement.id, null, this.options);
+ }
+});