Skip to content

Commit bdadbe3

Browse files
committed
Fix tab activation
1 parent 589f6ef commit bdadbe3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Ajax/semantic/html/modules/HtmlTab.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
* Semantic Tab component
1414
* @see http://semantic-ui.com/collections/tab.html
1515
* @author jc
16-
* @version 1.001
16+
* @version 1.02
1717
*/
1818
class HtmlTab extends HtmlSemCollection{
1919

2020
protected $params=[];
21+
protected $_activated=false;
2122

2223
public function __construct( $identifier, $tabs=array()){
2324
parent::__construct( $identifier, "div", "");
@@ -97,6 +98,7 @@ public function setTabsContent($contents){
9798
public function activate($index){
9899
$this->content["menu"]->getItem($index)->setActive(true);
99100
$this->content[$index]->setActive(true);
101+
$this->_activated=true;
100102
return $this;
101103
}
102104

@@ -244,7 +246,7 @@ public function run(JsUtils $js) {
244246
}
245247

246248
public function compile(JsUtils $js=NULL, &$view=NULL) {
247-
if($this->content["menu"]->count()>0 && \sizeof($this->content)>1)
249+
if(!$this->_activated && $this->content["menu"]->count()>0 && \sizeof($this->content)>1)
248250
$this->activate(0);
249251
return parent::compile($js,$view);
250252
}

0 commit comments

Comments
 (0)