summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TClientScriptManager.php
diff options
context:
space:
mode:
authorctrlaltca <ctrlaltca@gmail.com>2013-11-26 03:01:40 -0800
committerctrlaltca <ctrlaltca@gmail.com>2013-11-26 03:01:40 -0800
commita4e4839d9f09d27b6f0cba92fad0231632b3a04d (patch)
tree2a2f353f2f7b0fd6cde035068a2036ab630f688b /framework/Web/UI/TClientScriptManager.php
parent2b11341614ac4a15be697fa8acad07055154ac54 (diff)
parent65adcbec2cc9a00a5b0611e34c7141bf4e6d63f7 (diff)
Merge pull request #491 from pradosoft/jquery
Main development switch to Jquery
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);