diff options
author | ctrlaltca <> | 2013-01-22 22:43:34 +0000 |
---|---|---|
committer | ctrlaltca <> | 2013-01-22 22:43:34 +0000 |
commit | b97ece103198be2ff3dc1a259588fb849266534b (patch) | |
tree | 8def8331c78f4c9fea8da632b0d9ec5378aa4793 /framework/Web/UI/TClientScriptManager.php | |
parent | 89b713dad11390812873980e8a60c7fc408813f1 (diff) |
merged r3261, r3262 to trunk/
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
-rw-r--r-- | framework/Web/UI/TClientScriptManager.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 39cab493..cab002e4 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -770,14 +770,6 @@ abstract class TClientSideOptions extends TComponent private $_options; /** - * Constructor, initialize the options list. - */ - public function __construct() - { - $this->_options = Prado::createComponent('System.Collections.TMap'); - } - - /** * Adds on client-side event handler by wrapping the code within a * javascript function block. If the code begins with "javascript:", the * code is assumed to be a javascript function block rather than arbiturary @@ -797,7 +789,10 @@ abstract class TClientSideOptions extends TComponent */ protected function getOption($name) { - return $this->_options->itemAt($name); + if ($this->_options) + return $this->_options->itemAt($name); + else + return null; } /** @@ -806,7 +801,7 @@ abstract class TClientSideOptions extends TComponent */ protected function setOption($name, $value) { - $this->_options->add($name, $value); + $this->getOptions()->add($name, $value); } /** @@ -814,6 +809,8 @@ abstract class TClientSideOptions extends TComponent */ public function getOptions() { + if (!$this->_options) + $this->_options = Prado::createComponent('System.Collections.TMap'); return $this->_options; } |