Skip to content

Commit

Permalink
init js in ajax view
Browse files Browse the repository at this point in the history
  • Loading branch information
loveorigami committed Jan 4, 2016
1 parent 254436c commit 953d1ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Toggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);";
Expand Down

0 comments on commit 953d1ed

Please sign in to comment.