Commit 5be310bd by halweg

no message

parent 1fc76e1e
...@@ -302,6 +302,9 @@ ...@@ -302,6 +302,9 @@
} }
$('.chart-size-switch-item').click(function(data) { $('.chart-size-switch-item').click(function(data) {
if ($(this).hasClass('-active')) { if ($(this).hasClass('-active')) {
return; return;
} }
...@@ -314,12 +317,34 @@ ...@@ -314,12 +317,34 @@
} }
$.each($(".size-item"), function (x) { $.each($(".size-item"), function (x) {
var current = $(this).data('size-item-inc'); var current = $(this).data('size-item-inc');
if (currentType == 'inc' && type == 'cm') { if (typeof(current) == "number") {
var data = (current * percent - 0).toFixed(2); if (currentType == 'inc' && type == 'cm') {
} else { var data = (current * percent - 0).toFixed(2);
var data = $(this).data('size-item-inc'); } else {
var data = $(this).data('size-item-inc');
}
$(this).html(data);
} else if (typeof(current) == "string" && current.indexOf("-") != -1) {
var data = current.split("-");
if (data.length == 0) {
return;
}
let tmp = new Array();
for (var i = 0; i < data.length; i++) {
var currentSizeFloat = data[i];
if (currentType == 'inc' && type == 'cm') {
var res = (currentSizeFloat * percent - 0).toFixed(2);
tmp.push(res);
} else {
var res = $(this).data('size-item-inc');
tmp = res;
}
}
if (tmp instanceof Array) {
tmp = tmp.join('-');
}
$(this).html(tmp);
} }
$(this).html(data);
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment