mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-13 13:17:39 +03:00
B # 3883: fix error on resize disk (firefox) (#3884)
Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
parent
4636b3883c
commit
9693702c57
@ -80,9 +80,11 @@ define(function(require) {
|
||||
function _setup(context) {
|
||||
var that = this;
|
||||
Tips.setup(context);
|
||||
var oneTera = Humanize.sizeToMB("1024GB")*1024;
|
||||
var max = that.diskSize > oneTera? that.diskSize*1024 : oneTera;
|
||||
$( ".diskSlider", context).html(RangeSlider.html({
|
||||
min: that.diskSize,
|
||||
max: Humanize.sizeToMB("1024GB")*1024,
|
||||
max: max,
|
||||
initial: that.diskSize,
|
||||
name: "resize",
|
||||
max_value: ""
|
||||
@ -99,7 +101,12 @@ define(function(require) {
|
||||
document.getElementById("new_cost_resize").textContent = Locale.tr("Cost")+": "+ convertCostNumber(cost);
|
||||
});
|
||||
|
||||
$( ".uinput-slider-val", context).on("change", function(){
|
||||
$( ".uinput-slider-val", context).on("keypress", function(e){
|
||||
if(e.which === 13){
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
}).on("change", function(e){
|
||||
$( ".uinput-slider",context).val(Humanize.sizeToMB(($( ".uinput-slider-val",context).val()).toString())*1024);
|
||||
var cost = Humanize.sizeToMB($( ".uinput-slider",context).val())*that.diskCost;
|
||||
if(isNaN(cost)){
|
||||
@ -114,7 +121,6 @@ define(function(require) {
|
||||
}
|
||||
document.getElementById("new_cost_resize").textContent = Locale.tr("Cost")+": "+ convertCostNumber(cost);
|
||||
|
||||
|
||||
$('#' + DIALOG_ID + 'Form', context).submit(function() {
|
||||
var new_size = parseInt(Humanize.sizeToMB($( ".uinput-slider-val", context).val()));
|
||||
new_size = new_size.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user