Commit f9d87e82 by Crisu83

Added support for displaying and hiding BootMenu dropdowns.

parent ab68bfb3
......@@ -186,7 +186,7 @@ class BootInput extends CInputWidget
protected function 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->getError().$this->getHint();
echo '</div></div>';
......
......@@ -33,6 +33,21 @@ class BootMenu extends CMenu
parent::init();
}
/**
* 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.
* @param array $items the items to be normalized.
......
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