diff options
Diffstat (limited to 'framework/Web/UI/JuiControls/TJuiDraggable.php')
-rw-r--r-- | framework/Web/UI/JuiControls/TJuiDraggable.php | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/framework/Web/UI/JuiControls/TJuiDraggable.php b/framework/Web/UI/JuiControls/TJuiDraggable.php index 56e6c7e7..ed5c3814 100644 --- a/framework/Web/UI/JuiControls/TJuiDraggable.php +++ b/framework/Web/UI/JuiControls/TJuiDraggable.php @@ -51,14 +51,33 @@ class TJuiDraggable extends TActivePanel implements IJuiOptions, ICallbackEventH } /** + * @return string the name of the jQueryUI widget method + */ + public function getWidget() + { + return 'draggable'; + } + + /** + * @return string the clientid of the jQueryUI widget element + */ + public function getWidgetID() + { + return $this->getClientID(); + } + + /** * Object containing defined javascript options * @return TJuiControlOptions */ public function getOptions() { - if($this->_options===null) - $this->_options=new TJuiControlOptions($this); - return $this->_options; + if (($options=$this->getViewState('JuiOptions'))===null) + { + $options=new TJuiControlOptions($this); + $this->setViewState('JuiOptions', $options); + } + return $options; } /** @@ -98,7 +117,7 @@ class TJuiDraggable extends TActivePanel implements IJuiOptions, ICallbackEventH $writer->addAttribute('id',$this->getClientID()); $options=TJavascript::encode($this->getPostBackOptions()); $cs=$this->getPage()->getClientScript(); - $code="jQuery('#".$this->getClientId()."').draggable(".$options.");"; + $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; $cs->registerEndScript(sprintf('%08X', crc32($code)), $code); } |