nutritionix/nutrition-label

add a new setting for the 2018 label to allow to only show the textServingSize

Closed this issue · 0 comments

related to #122 where the aim is to show the label with the 9.3 (valueServingUnitQuantity)

one one of the demo (will be added after task #121 is done), there is an extra serving unit quantity value when this code is used

$('#test7').nutritionLabel({
	showServingUnitQuantityTextbox : false,
	showServingWeightGrams : false,
	showIngredients : false,
	showServingsPerContainer : false,
	showItemName : false,

	showServingUnitQuantity : false,
	showOnlyTheTextServingSize: true,
	textServingSize : 'Serving Size 6.96 10-inch pizza (3.7819<span aria-hidden="true">g</span><span class="sr-only"> grams</span>)',
	valueServingUnitQuantity : 9.3, //should not appear on the label, see https://github.com/nutritionix/nutrition-label/issues/122

	valueCalories : 400,
	valueFatCalories : 220,
	valueTotalFat : 24,
	valueSatFat : 15,
	valueCholesterol : 25,
	valueSodium : 430,
	valueTotalCarb : 44,
	valueSugars : 24,
	valueProteins : 4,
	valueVitaminD : 12.22,
	valuePotassium_2018 : 4.22,
	valueCalcium : 7.22,
	valueIron : 11.22,
	showLegacyVersion : false
});

2018 Version Demo Page