summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/Web/UI/WebControls/TClientScript.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/TClientScript.php b/framework/Web/UI/WebControls/TClientScript.php
index 41bf8b57..325105bc 100644
--- a/framework/Web/UI/WebControls/TClientScript.php
+++ b/framework/Web/UI/WebControls/TClientScript.php
@@ -111,7 +111,17 @@ class TClientScript extends TControl
protected function renderCustomScriptFile($writer)
{
if(($scriptUrl = $this->getScriptUrl())!=='')
- $writer->write("<script type=\"text/javascript\" src=\"$scriptUrl\"></script>\n");
+ {
+ if($this->getPage()->getIsCallback())
+ {
+ $cs = $this->getPage()->getClientScript();
+ $uniqueid=$this->ClientID.'_custom';
+ if(!$cs->isScriptFileRegistered($uniqueid))
+ $cs->registerScriptFile($uniqueid, $scriptUrl);
+ } else {
+ $writer->write("<script type=\"text/javascript\" src=\"$scriptUrl\"></script>\n");
+ }
+ }
}
/**