Skip to content

Commit 4924e44

Browse files
committed
tab activation
1 parent c8eebbc commit 4924e44

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Ajax/semantic/components/Tab.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public function __construct(JsUtils $js) {
1111
parent::__construct($js);
1212
$this->uiName="tab";
1313
}
14-
14+
public function setDebug($value=true) {
15+
return $this->setParam("debug", $value);
16+
}
1517
//TODO other events implementation
1618
}

Ajax/semantic/html/modules/HtmlTab.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88
use Ajax\JsUtils;
99

1010
class HtmlTab extends HtmlSemCollection{
11-
protected $params=array();
11+
protected $params=array("debug"=>true);
1212

1313
public function __construct( $identifier, $tabs=array()){
1414
parent::__construct( $identifier, "div", "");
1515
$menu=new HtmlMenu("menu".$this->identifier);
1616
$menu->asTab(false)->setAttachment(NULL,Side::TOP);
1717
$this->content["menu"]=$menu;
1818
$this->addItems($tabs);
19-
if(\sizeof($tabs)>0)
20-
$this->activate(0);
2119
}
2220

2321
protected function createItem($value){
@@ -80,4 +78,9 @@ public function run(JsUtils $js) {
8078
$this->addEventsOnRun($js);
8179
return $this->_bsComponent;
8280
}
81+
public function compile(JsUtils $js=NULL, &$view=NULL) {
82+
if($this->content["menu"]->count()>0)
83+
$this->activate(0);
84+
return parent::compile($js,$view);
85+
}
8386
}

0 commit comments

Comments
 (0)