From 77e34ac91f7ff7b97f797e0b5203cf56ed436899 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Thu, 30 May 2013 00:23:12 +0400 Subject: [PATCH] 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); + } +}