Revize a9fb2046
Přidáno uživatelem Jan Čarnogurský před téměř 5 roky(ů)
src/main/webapp/WEB-INF/templates/assembly_manage.html | ||
---|---|---|
102 | 102 |
</div> |
103 | 103 |
</div> |
104 | 104 |
|
105 |
<div th:classappend="!(*{parameters[__${i.index}__].parameterType.name.equals('Výčet')}) ? hidden" class="enum_box">
|
|
105 |
<div th:classappend="!(*{parameters[__${i.index}__].parameterType.name.equals('Výčet')}) ? 'hidden' : ''" class="enum_box">
|
|
106 | 106 |
Hodnoty: |
107 | 107 |
<div class="enum_values col-md-8"> |
108 | 108 |
<div class="enum-wrapper"> |
109 | 109 |
<input type="hidden" class="enum-index" th:value="${i.index}"> |
110 | 110 |
<div th:each="parameterValue, j : *{parameters[__${i.index}__].parameterValues}" class="input-action-box input-border-bottom enum-row"> |
111 |
<input type="hidden" class="enum-parameter-index" th:value="${j.index}"> |
|
111 | 112 |
<input type="text" readonly class="form-control-plaintext" th:field="*{parameters[__${i.index}__].parameterValues[__${j.index}__].value}" th:value="*{parameters[__${i.index}__].parameterValues[__${j.index}__].value}"> |
112 | 113 |
|
113 | 114 |
<span class="action-padding input-action-margin sort-icon"> |
src/main/webapp/js/assemblyManageScripts.js | ||
---|---|---|
125 | 125 |
function addEnumRow(context, value) |
126 | 126 |
{ |
127 | 127 |
let enumIndex = $(context).closest('.enum_box').find('.enum-index').val(); |
128 |
let countIndex = $(context).closest('.enum_box').find('.enum-row').length; |
|
128 |
|
|
129 |
var countIndex = 0; |
|
130 |
|
|
131 |
// find largest parameter index |
|
132 |
$(".enum-row").each(function () |
|
133 |
{ |
|
134 |
var tmpIndex = Number($(this).find('.enum-parameter-index').val()); |
|
135 |
|
|
136 |
if (tmpIndex >= countIndex) |
|
137 |
{ |
|
138 |
countIndex = tmpIndex + 1; |
|
139 |
} |
|
140 |
}); |
|
141 |
|
|
129 | 142 |
|
130 | 143 |
let row = document.createElement('div'); |
131 | 144 |
row.classList.add('input-action-box', 'input-border-bottom', 'enum-row'); |
... | ... | |
139 | 152 |
input.setAttribute('id', `parameters${enumIndex}.parameterValues${countIndex}.value`); |
140 | 153 |
input.setAttribute('name', `parameters[${enumIndex}].parameterValues[${countIndex}].value`); |
141 | 154 |
|
155 |
let inputIndex = document.createElement('input'); |
|
156 |
inputIndex.type = 'hidden'; |
|
157 |
inputIndex.classList.add('enum-parameter-index'); |
|
158 |
inputIndex.setAttribute('value', countIndex); |
|
159 |
|
|
142 | 160 |
row.appendChild(input); |
161 |
row.appendChild(inputIndex); |
|
143 | 162 |
|
144 | 163 |
let sortSpan = document.createElement('span'); |
145 | 164 |
sortSpan.classList.add('action-padding', 'input-action-margin', 'sort-icon'); |
Také k dispozici: Unified diff
re #7991 - update calculation for parameter enum value