Skip to content

Commit 574fab1

Browse files
author
Eugene Tupikov
committed
Fix
1 parent 0dd00cf commit 574fab1

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

MultipleInput.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function init()
7070
public function run()
7171
{
7272
echo Html::beginTag('div', [
73-
'class' => 'list-group list-group-' . $this->getGroupId(),
73+
'class' => 'list-group list-group-' . $this->getId(),
7474
]);
7575
echo Html::beginTag('table', [
7676
'class' => 'multiple-input-list table table-condensed'
@@ -210,7 +210,7 @@ private function getRowTemplate()
210210
'type' => '{btn_type}',
211211
'options' => [
212212
'id' => $this->getElementId('button'),
213-
'class' => "ps-button multiple-input-list__btn btn js-{$this->getGroupId()}-input-{btn_action}",
213+
'class' => "ps-button multiple-input-list__btn btn js-{$this->getId()}-input-{btn_action}",
214214
]
215215
]
216216
);
@@ -295,15 +295,7 @@ private function normalize($name) {
295295
return str_replace(['[]', '][', '[', ']', ' ', '.'], ['', '-', '-', '', '-', '-'], strtolower($name));
296296
}
297297

298-
/**
299-
* @return mixed
300-
*/
301-
private function getGroupId()
302-
{
303-
return $this->normalize($this->getName()) . static::$counter;
304-
}
305-
306-
/**
298+
/**
307299
* @return string
308300
*/
309301
private function getName()
@@ -336,7 +328,7 @@ public function registerClientScript()
336328
MultipleInputAsset::register($view);
337329
$options = Json::encode(
338330
[
339-
'group_id' => $this->getGroupId(),
331+
'group_id' => $this->getId(),
340332
'template' => $this->getRowTemplate(),
341333
'btn_action' => self::ACTION_REMOVE,
342334
'btn_type' => Button::TYPE_DANGER,

0 commit comments

Comments
 (0)