From 303edb1dd308d3812102fbe25438e56413cd79a3 Mon Sep 17 00:00:00 2001 From: tof <> Date: Mon, 13 Oct 2008 13:40:34 +0000 Subject: Added drag and drop components --- framework/Web/Javascripts/source/packages.php | 5 +++-- .../source/prado/activecontrols/dragdrop.js | 24 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js (limited to 'framework/Web/Javascripts/source') 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); + } +}); -- cgit v1.2.3