From 953d1edfd227039438d2276c7b801308a04cfd42 Mon Sep 17 00:00:00 2001 From: Loveorigami Date: Mon, 4 Jan 2016 10:01:01 +0300 Subject: [PATCH] init js in ajax view --- Toggle.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Toggle.php b/Toggle.php index 4e74c0f..890c28a 100644 --- a/Toggle.php +++ b/Toggle.php @@ -77,9 +77,8 @@ public function registerClientScript() $view = $this->view; ToggleAsset::register($view); //$this->clientOptions['animate'] = ArrayHelper::getValue($this->clientOptions, 'animate', true); - //$options = Json::encode($this->clientOptions); - //$js[] = "jQuery('$this->selector').bootstrapToggle($options);"; - $js=[]; + $options = Json::encode($this->options); + $js[] = "jQuery('$this->selector').bootstrapToggle($options);"; if (!empty($this->clientEvents)) { foreach ($this->clientEvents as $event => $handler) { $js[] = "jQuery('$this->selector').on('$event', $handler);";