Projekt

Obecné

Profil

« Předchozí | Další » 

Revize a9fb2046

Přidáno uživatelem Jan Čarnogurský před asi 4 roky(ů)

re #7991 - update calculation for parameter enum value

Zobrazit rozdíly:

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