Skip to content

Commit dfdbfa8

Browse files
committed
Make dropdowns clearable (see semantic 2.4)
1 parent be8276b commit dfdbfa8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Ajax/semantic/components/Dropdown.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@ public function setShowOnFocus($value){
4040
public function setAllowAdditions($value){
4141
return $this->setParam("allowAdditions", $value);
4242
}
43+
44+
public function setClearable($value){
45+
return $this->setParam("clearable", $value);
46+
}
4347
}

Ajax/semantic/html/modules/HtmlDropdown.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,4 +396,8 @@ public function jsAddItem($caption){
396396
$js="var first=$('#{$this->identifier} .item').first();if(first!=undefined){var new =first.clone();first.parent().append(new);first.html('{$caption}};')";
397397
return $js;
398398
}
399+
400+
public function setClearable($value){
401+
$this->_params["clearable"]=$value;
402+
}
399403
}

0 commit comments

Comments
 (0)