Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unify dropdown with lookup, rm custom dropIcon
Browse files Browse the repository at this point in the history
mvorisek committed Jun 5, 2023
1 parent 6501a26 commit 84233ba
Showing 3 changed files with 2 additions and 16 deletions.
14 changes: 0 additions & 14 deletions src/Form/Control/Dropdown.php
Original file line number Diff line number Diff line change
@@ -33,16 +33,6 @@ class Dropdown extends Input
/** @var string The string to set as an empty values. */
public $empty = "\u{00a0}"; // Unicode NBSP

/**
* The icon to display at the dropdown menu.
* The template default is set to: 'dropdown'.
* Note: dropdown icon is show on the right side of the menu
* while other icon are usually display on the left side.
*
* @var string|null
*/
public $dropIcon;

/** @var array Dropdown options as per Fomantic-UI dropdown options. */
public $dropdownOptions = [];

@@ -242,10 +232,6 @@ protected function renderView(): void
$this->setDropdownOption('onShow', new JsFunction([], [new JsExpression('return false')]));
}

if ($this->dropIcon) {
$this->template->set('DropIcon', $this->dropIcon);
}

$this->template->set('DefaultText', $this->empty);

$this->htmlRenderValue();
2 changes: 1 addition & 1 deletion template/form/control/dropdown.html
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<div {$attributes}>
{$BeforeInput}{$AfterBeforeInput}
{$Input}
<i class="{DropIcon}dropdown{/} icon"></i>
<i class="dropdown icon"></i>
<div class="default text">{$DefaultText}</div>
<input class="search" {$disabled} style="width: 100%;">
<div class="menu">
2 changes: 1 addition & 1 deletion template/form/control/dropdown.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
| <div {$attributes}>
| {$BeforeInput}{$AfterBeforeInput}
| {$Input}
| <i class="{DropIcon}dropdown{/} icon"></i>
| <i class="dropdown icon"></i>
| <div class="default text">{$DefaultText}</div>
| <input class="search" {$disabled} style="width: 100%;">
| <div class="menu">

0 comments on commit 84233ba

Please sign in to comment.