ExtensibleSet: drop-down-like button for drop-...

...down-like elements
This commit is contained in:
Thomas Gelf 2017-09-27 08:34:13 +02:00
parent 5b1c143a1c
commit 748c3668e2
2 changed files with 24 additions and 4 deletions

View File

@ -30,6 +30,7 @@ class IconHelper
'angle-double-right' => 'e87b',
'up-big' => 'e825',
'down-big' => 'e828',
'down-open' => 'e821',
);
private $mappedUtf8Icons;

View File

@ -273,10 +273,19 @@ class ExtensibleSetElement extends BaseElement
$field->attributes()->add('class', 'extend-set');
}
$this->add(Html::tag('li', null, [
$this->createAddNewButton(),
$field
]));
if ($this->suggestionContext === null) {
$this->add(Html::tag('li', null, [
$this->createAddNewButton(),
$field
]));
} else {
$this->add(Html::tag('li', null, [
$this->newInlineButtons(
$this->renderDropDownButton()
),
$field
]));
}
}
private function createAddNewButton()
@ -444,6 +453,16 @@ class ExtensibleSetElement extends BaseElement
}
}
private function renderDropDownButton()
{
return $this->createRelatedAction(
'drop-down',
$this->name,
$this->translate('Show available options'),
'down-open'
);
}
private function renderAddButton()
{
return $this->createRelatedAction(