From c85877424e86460f10d3db18ac823250ee16fc5e Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 13 Jan 2016 17:45:04 +0100 Subject: [PATCH] bug #4227: Fix template instantiate when image size is 0 --- src/sunstone/public/app/utils/disks-resize.js | 10 ++++++---- src/sunstone/public/app/utils/range-slider.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/app/utils/disks-resize.js b/src/sunstone/public/app/utils/disks-resize.js index 0f28713e28..205c16dd63 100644 --- a/src/sunstone/public/app/utils/disks-resize.js +++ b/src/sunstone/public/app/utils/disks-resize.js @@ -154,10 +154,12 @@ define(function(require){ $(".diskContainer", context).each(function(){ if ($(this).data("template_disk")) { disk = $(this).data("template_disk"); - original_size = $(this).data("original_size"); - size = $("#SIZE", this).val(); - if (size) { - disk['SIZE'] = Math.ceil(size * 1024); + + if ($("#SIZE", this).is(':enabled')) { + size = $("#SIZE", this).val(); + if (size) { + disk['SIZE'] = Math.ceil(size * 1024); + } } } diff --git a/src/sunstone/public/app/utils/range-slider.js b/src/sunstone/public/app/utils/range-slider.js index a5ebb4f867..a945f7ec2c 100644 --- a/src/sunstone/public/app/utils/range-slider.js +++ b/src/sunstone/public/app/utils/range-slider.js @@ -58,7 +58,7 @@ define(function(require) { } }); - if (opts.startValue) { + if (opts.startValue != undefined) { slider.foundation('slider', 'set_value', opts.startValue); input.val(opts.startValue); }