mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
parent
985193ffff
commit
c40b8334fc
|
@ -229,13 +229,13 @@
|
||||||
|
|
||||||
var auto_tag = $("#asset_tag").val().replace(/[^\d]/g, '');
|
var auto_tag = $("#asset_tag").val().replace(/[^\d]/g, '');
|
||||||
var box_html = '';
|
var box_html = '';
|
||||||
|
const zeroPad = (num, places) => String(num).padStart(places, '0');
|
||||||
|
|
||||||
// Check that we haven't exceeded the max number of asset fields
|
// Check that we haven't exceeded the max number of asset fields
|
||||||
if (x < max_fields) {
|
if (x < max_fields) {
|
||||||
|
|
||||||
if (auto_tag!='') {
|
if (auto_tag!='') {
|
||||||
auto_tag = parseInt(auto_tag) + parseInt(x);
|
auto_tag = zeroPad(parseInt(auto_tag) + parseInt(x),auto_tag.length);
|
||||||
} else {
|
} else {
|
||||||
auto_tag = '';
|
auto_tag = '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue