mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CS-16016: Reset input field to default value on add
Conflicts: ui/scripts/vpc.js
This commit is contained in:
parent
48521e74e6
commit
5633ad0beb
@ -782,7 +782,11 @@
|
||||
);
|
||||
|
||||
if (field.isDisabled) $input.hide();
|
||||
if (field.defaultValue) $input.val(field.defaultValue);
|
||||
|
||||
if (field.defaultValue) {
|
||||
$input.val(field.defaultValue);
|
||||
$input.data('multi-default-value', field.defaultValue);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var $input = $('<input>')
|
||||
@ -795,7 +799,10 @@
|
||||
.appendTo($td);
|
||||
|
||||
if (field.isDisabled) $input.hide();
|
||||
if (field.defaultValue) $input.val(field.defaultValue);
|
||||
if (field.defaultValue) {
|
||||
$input.val(field.defaultValue);
|
||||
$input.data('multi-default-value', field.defaultValue);
|
||||
}
|
||||
}
|
||||
} else if (field.custom) {
|
||||
$('<div>').addClass('button add-vm custom-action')
|
||||
@ -887,7 +894,15 @@
|
||||
$dataBody.prepend($loading);
|
||||
|
||||
// Clear out fields
|
||||
$multi.find('input').val('');
|
||||
$multi.find('input').each(function() {
|
||||
var $input = $(this);
|
||||
|
||||
if ($input.data('multi-default-value')) {
|
||||
$input.val($input.data('multi-default-value'));
|
||||
} else {
|
||||
$input.val('');
|
||||
}
|
||||
});
|
||||
$multi.find('tbody td').each(function() {
|
||||
var $item = $(this);
|
||||
|
||||
|
||||
@ -111,8 +111,8 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'icmptype': { edit: true, label: 'ICMP.type', isDisabled: true , desc:'Please specify -1 if you want to allow any', defaultValue:'-1'},
|
||||
'icmpcode': { edit: true, label: 'ICMP.code', isDisabled: true , desc:'Please specify -1 if you want to allow any', defaultValue:'-1'},
|
||||
'icmptype': { edit: true, label: 'ICMP.type', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP types', defaultValue:'-1' },
|
||||
'icmpcode': { edit: true, label: 'ICMP.code', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP codes', defaultValue:'-1' },
|
||||
'traffictype' : {
|
||||
label: 'Traffic type',
|
||||
select: function(args) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user