summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TClientScriptManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
-rw-r--r--framework/Web/UI/TClientScriptManager.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index ea828187..a9f6c5b4 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -286,8 +286,6 @@ class TClientScriptManager extends TApplicationComponent
$code="new {$class}({$optionString});";
$this->_endScripts[sprintf('%08X', crc32($code))]=$code;
- $this->_hiddenFields[TPage::FIELD_POSTBACK_TARGET]='';
- $this->_hiddenFields[TPage::FIELD_POSTBACK_PARAMETER]='';
$this->registerPradoScriptInternal('prado');
$params=func_get_args();
@@ -315,7 +313,6 @@ class TClientScriptManager extends TApplicationComponent
$code = "new Prado.WebUI.DefaultButton($options);";
$this->_endScripts['prado:'.$panelID]=$code;
- $this->_hiddenFields[TPage::FIELD_POSTBACK_TARGET]='';
$this->registerPradoScriptInternal('prado');
$params=array($panelID,$buttonID);
@@ -343,11 +340,10 @@ class TClientScriptManager extends TApplicationComponent
*/
public function registerFocusControl($target)
{
- $this->registerPradoScriptInternal('effects');
+ $this->registerPradoScriptInternal('jquery');
if($target instanceof TControl)
$target=$target->getClientID();
- $id = TJavaScript::quoteString($target);
- $this->_endScripts['prado:focus'] = 'new Effect.ScrollTo('.$id.'); Prado.Element.focus('.$id.');';
+ $this->_endScripts['prado:focus'] = 'new Prado.Element.scrollTo(\''.$target.'\'); jQuery(\'#'.$target.'\').focus();';
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerFocusControl',$params);
@@ -700,6 +696,22 @@ class TClientScriptManager extends TApplicationComponent
$writer->write(TJavaScript::renderScriptBlocks($this->_endScripts));
}
+ /**
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function renderBeginScriptsCallback($writer)
+ {
+ $writer->write(TJavaScript::renderScriptBlocksCallback($this->_beginScripts));
+ }
+
+ /**
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function renderEndScriptsCallback($writer)
+ {
+ $writer->write(TJavaScript::renderScriptBlocksCallback($this->_endScripts));
+ }
+
public function renderHiddenFieldsBegin($writer)
{
$this->renderHiddenFieldsInt($writer,true);