mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-27 03:21:29 +03:00
Bug #4017: Disable slider for persistent images. Add label to volatile disks
This commit is contained in:
parent
165e279567
commit
dd3d1efb36
@ -108,15 +108,20 @@ define(function(require){
|
||||
|
||||
var sizeGB = disk.SIZE / 1024;
|
||||
diskContext.data('original_size', sizeGB);
|
||||
|
||||
var label = disk.IMAGE ? disk.IMAGE : Locale.tr("Volatile Disk");
|
||||
var enabled = !(disk.PERSISTENT && disk.PERSISTENT.toUpperCase() == "YES");
|
||||
|
||||
RangeSlider.insert({
|
||||
'label': disk.IMAGE,
|
||||
'label': label,
|
||||
'unitLabel': 'GB',
|
||||
'name': 'SIZE',
|
||||
'start': sizeGB,
|
||||
'end': sizeGB + 500,
|
||||
'step': 10,
|
||||
'startValue': sizeGB
|
||||
}, $(".diskSlider", diskContext))
|
||||
'startValue': sizeGB,
|
||||
'enabled': enabled
|
||||
}, $(".diskSlider", diskContext));
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -32,6 +32,7 @@ define(function(require) {
|
||||
opts.end End value of the slider
|
||||
opts.step Step value of the slider
|
||||
opts.startValue Initialize the slider with this value
|
||||
opts.enabled false to disable the inputs (true by default)
|
||||
@param {Object} context div to insert the range slider
|
||||
@returns {String} HTML row
|
||||
*/
|
||||
@ -61,5 +62,10 @@ define(function(require) {
|
||||
slider.foundation('slider', 'set_value', opts.startValue);
|
||||
input.val(opts.startValue);
|
||||
}
|
||||
|
||||
if (opts.enabled == false){
|
||||
input.attr('disabled', 'disabled');
|
||||
slider.attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user