From 77e34ac91f7ff7b97f797e0b5203cf56ed436899 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Thu, 30 May 2013 00:23:12 +0400 Subject: [PATCH 1/2] jQuery UI draggable widget --- framework/yii/jui/Draggable.php | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 framework/yii/jui/Draggable.php diff --git a/framework/yii/jui/Draggable.php b/framework/yii/jui/Draggable.php new file mode 100644 index 0000000..adf92f1 --- /dev/null +++ b/framework/yii/jui/Draggable.php @@ -0,0 +1,52 @@ + array( + * 'modal' => true, + * ), + * )); + * + * echo 'Draggable contents here...'; + * + * Draggable::end(); + * ``` + * + * @see http://api.jqueryui.com/draggable/ + * @author Alexander Kochetov + * @since 2.0 + */ +class Draggable extends Widget +{ + /** + * Initializes the widget. + */ + public function init() + { + parent::init(); + echo Html::beginTag('div', $this->options) . "\n"; + } + + /** + * Renders the widget. + */ + public function run() + { + echo Html::endTag('div') . "\n"; + $this->registerWidget('draggable', false); + } +} From 670a16200da80c364e37c9527fecba00a7d52e55 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Thu, 30 May 2013 00:25:14 +0400 Subject: [PATCH 2/2] Change example option --- framework/yii/jui/Draggable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/jui/Draggable.php b/framework/yii/jui/Draggable.php index adf92f1..c73f269 100644 --- a/framework/yii/jui/Draggable.php +++ b/framework/yii/jui/Draggable.php @@ -17,7 +17,7 @@ use yii\helpers\Html; * ```php * Draggable::begin(array( * 'clientOptions' => array( - * 'modal' => true, + * 'grid' => array(50, 20), * ), * )); *