The following code runs fine from the #input-lines-percent inputs and updates the values correctly. #input-curves-percent does run the code so the change seems to be working, but it's not updating the text boxes at all.
To see what I mean, type some text in the Straight lines % box and see how both text boxes update. However try this on the Curves % and there is no update. The code for both is almost identical, so I am not sure what is causing this difference.
$('#input-curves-percent').change(function(e){
updatePercentGroupShape('curve');
});
$('#input-lines-percent').change(function(e){
updatePercentGroupShape('line');
});
function updatePercentGroupShape(lastEdit){
// Updates the percentage boxes for the shape type percents
var curves = parseInt($('#input-curves-percent').val());
var lines = parseInt($('#input-lines-percent').val());
if(lastEdit.localeCompare('curve') == 0){
if(curves < 0){
curves == 0;
}else if(curves > 100){
curves = 100;
}
lines = 100 - curves;
}
if(lastEdit.localeCompare('line') == 0){
if(lines < 0){
lines == 0;
}else if(lines > 100){
lines = 100;
}
curves = 100 - lines;
}
$('#input-curves-percent').val(curves);
$('#input-line-percent').val(lines);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<div>Curves %</div>
<div><input type="text" id="input-curves-percent" value="0"></div>
</div>
<div>
<div>Straight lines %</div>
<div><input type="text" id="input-lines-percent" value="100"></div>
</div>