diff options
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
-rw-r--r-- | framework/Web/UI/TClientScriptManager.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index cab002e4..8a7afdad 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -7,7 +7,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id$ + * @version $Id: TClientScriptManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -18,7 +18,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering) - * @version $Id$ + * @version $Id: TClientScriptManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -758,7 +758,7 @@ class TClientScriptManager extends TApplicationComponent * between ActiveControls and validators. * * @author <weizhuo[at]gmail[dot]com> - * @version $Id$ + * @version $Id: TClientScriptManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -770,6 +770,14 @@ 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 @@ -789,10 +797,7 @@ abstract class TClientSideOptions extends TComponent */ protected function getOption($name) { - if ($this->_options) - return $this->_options->itemAt($name); - else - return null; + return $this->_options->itemAt($name); } /** @@ -801,7 +806,7 @@ abstract class TClientSideOptions extends TComponent */ protected function setOption($name, $value) { - $this->getOptions()->add($name, $value); + $this->_options->add($name, $value); } /** @@ -809,8 +814,6 @@ abstract class TClientSideOptions extends TComponent */ public function getOptions() { - if (!$this->_options) - $this->_options = Prado::createComponent('System.Collections.TMap'); return $this->_options; } |