Code-style fixes

Contributes to CURA-5408
This commit is contained in:
Ian Paschal 2018-07-09 14:39:13 +02:00
parent 52f6037576
commit a596c5a034

View File

@ -515,7 +515,7 @@ TabView
if(entry_name in materialPreferenceValues[material_guid] && materialPreferenceValues[material_guid][entry_name] == new_value)
{
// value has not changed
return
return;
}
materialPreferenceValues[material_guid][entry_name] = new_value;
@ -531,34 +531,33 @@ TabView
}
var material_weight = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "properties", "weight");
if(material_weight != undefined && material_weight != "")
{
return material_weight
}
return 0;
return material_weight || 0;
}
// update the display name of the material
function updateMaterialDisplayName (old_name, new_name) {
function updateMaterialDisplayName (old_name, new_name)
{
// don't change when new name is the same
if (old_name == new_name) {
return
return;
}
// update the values
base.materialManager.setMaterialName(base.currentMaterialNode, new_name)
materialProperties.name = new_name
base.materialManager.setMaterialName(base.currentMaterialNode, new_name);
materialProperties.name = new_name;
}
// update the type of the material
function updateMaterialType (old_type, new_type) {
base.setMetaDataEntry("material", old_type, new_type)
materialProperties.material= new_type
function updateMaterialType (old_type, new_type)
{
base.setMetaDataEntry("material", old_type, new_type);
materialProperties.material= new_type;
}
// update the brand of the material
function updateMaterialBrand (old_brand, new_brand) {
base.setMetaDataEntry("brand", old_brand, new_brand)
materialProperties.brand = new_brand
function updateMaterialBrand (old_brand, new_brand)
{
base.setMetaDataEntry("brand", old_brand, new_brand);
materialProperties.brand = new_brand;
}
}