Disable "unallocate" button if there are not any allocations

This commit is contained in:
Oliver Walters 2020-10-27 09:26:16 +11:00
parent b5e1d3f87a
commit 06a3899325

View File

@ -576,7 +576,13 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
html += makeIconButton('fa-sign-in-alt icon-green', 'button-add', row.sub_part, '{% trans "Allocate stock" %}'); html += makeIconButton('fa-sign-in-alt icon-green', 'button-add', row.sub_part, '{% trans "Allocate stock" %}');
} }
html += makeIconButton('fa-times-circle icon-red', 'button-unallocate', row.sub_part, '{% trans "Unallocate stock" %}'); html += makeIconButton(
'fa-minus-circle icon-red', 'button-unallocate', row.sub_part,
'{% trans "Unallocate stock" %}',
{
disabled: row.allocations == null
}
);
html += '</div>'; html += '</div>';