diff options
author | ctrlaltca@gmail.com <> | 2011-06-24 22:12:36 +0000 |
---|---|---|
committer | ctrlaltca@gmail.com <> | 2011-06-24 22:12:36 +0000 |
commit | 15f6747485b5912f657c2c0fce8f41c01c70d2ad (patch) | |
tree | d2621fd086e8da91313b8880a5ad524f8518aac3 /framework/Web/UI/ActiveControls/TDraggable.php | |
parent | a0d269954534e09c0b9c0f73c927b6eb764c21d9 (diff) |
merged in the patch for progressive rendering from #235; unit tests doesn't evidence any regression, but of course more proper testing is needed
Diffstat (limited to 'framework/Web/UI/ActiveControls/TDraggable.php')
-rwxr-xr-x | framework/Web/UI/ActiveControls/TDraggable.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/framework/Web/UI/ActiveControls/TDraggable.php b/framework/Web/UI/ActiveControls/TDraggable.php index 34d8c548..10e78b9b 100755 --- a/framework/Web/UI/ActiveControls/TDraggable.php +++ b/framework/Web/UI/ActiveControls/TDraggable.php @@ -136,6 +136,20 @@ class TDraggable extends TPanel $this->setViewState('Constraint', TPropertyValue::ensureEnum($value, 'TDraggableConstraint'), TDraggableConstraint::None); } + /** + * Registers clientscripts + * + * This method overrides the parent implementation and is invoked before render. + * @param mixed event parameter + */ + public function onPreRender($param) + { + parent::onPreRender($param); + if ($this->getGhosting()==TDraggableGhostingOptions::SuperGhosting) + $cs->registerPradoScript('dragdropextra'); + else + $cs->registerPradoScript('dragdrop'); + } /** * Ensure that the ID attribute is rendered and registers the javascript code @@ -145,11 +159,6 @@ class TDraggable extends TPanel { parent::addAttributesToRender($writer); $writer->addAttribute('id',$this->getClientID()); - $cs=$this->getPage()->getClientScript(); - if ($this->getGhosting()==TDraggableGhostingOptions::SuperGhosting) - $cs->registerPradoScript('dragdropextra'); - else - $cs->registerPradoScript('dragdrop'); $options=TJavascript::encode($this->getPostBackOptions()); $class=$this->getClientClassName(); $code="new {$class}('{$this->getClientId()}', {$options}) "; |