Commit f9d87e82 by Crisu83

Added support for displaying and hiding BootMenu dropdowns.

parent ab68bfb3
...@@ -186,7 +186,7 @@ class BootInput extends CInputWidget ...@@ -186,7 +186,7 @@ class BootInput extends CInputWidget
protected function captcha() protected function captcha()
{ {
echo $this->getLabel().'<div class="input"><div class="captcha">'; echo $this->getLabel().'<div class="input"><div class="captcha">';
echo '<div class="widget">'.$this->widget('CCaptcha', array(), true).'</div>'; echo '<div class="widget">'.$this->widget('CCaptcha', array('showRefreshButton'=>false), true).'</div>';
echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions); echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);
echo $this->getError().$this->getHint(); echo $this->getError().$this->getHint();
echo '</div></div>'; echo '</div></div>';
......
...@@ -34,6 +34,21 @@ class BootMenu extends CMenu ...@@ -34,6 +34,21 @@ class BootMenu extends CMenu
} }
/** /**
* Runs the menu widget.
*/
public function run()
{
parent::run();
$id = $this->getId();
Yii::app()->clientScript->registerScript(__CLASS__.'#'.$id,"
jQuery('#{$id} .dropdown-toggle').bind('click', function() {
$(this).parent().toggleClass('open');
});
");
}
/**
* Normalizes the items so that the 'active' state is properly identified for every menu item. * Normalizes the items so that the 'active' state is properly identified for every menu item.
* @param array $items the items to be normalized. * @param array $items the items to be normalized.
* @param string $route the route of the current request. * @param string $route the route of the current request.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment