Code minor adjustments.

Code minor adjustments to be compliant with the coding convention.
This commit is contained in:
Alezia Kurdis 2020-03-02 23:13:47 -05:00 committed by GitHub
parent 4a1926a901
commit d1c641de49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
//VERSION 2.0
// Modified by Alezia Kurdis on on 02/27/2020
// Modified by Alezia Kurdis on on 02/27/2020
// for "Project Athena"
//
// Addition of a tab mechanism instead of collapsible sections to reduce the scrolling.
@ -1885,7 +1885,7 @@ function showGroupsForType(type) {
showOnTheSamePage("Shape");
return;
}
if (type === "None"){
if (type === "None") {
showGroupsForTypes(["None"]);
return;
}
@ -1905,9 +1905,9 @@ function showGroupsForTypes(types) {
Object.entries(elGroups).forEach(([groupKey, elGroup]) => {
if (types.map(type => GROUPS_PER_TYPE[type].includes(groupKey)).every(function (hasGroup) { return hasGroup; })) {
elGroup.style.display = "none";
if(types != "None"){
if (types !== "None") {
document.getElementById("tab-" + groupKey).style.display = "block";
}else{
} else {
document.getElementById("tab-" + groupKey).style.display = "none";
}
} else {
@ -4018,13 +4018,13 @@ function loaded() {
elGroup.setAttribute("id", "properties-" + group.id);
elPropertiesList.appendChild(elGroup);
if (group.label !== undefined) {
let elLegend = document.createElement('div');
elLegend.className = "tab-section-header";
elLegend.appendChild(createElementFromHTML(`<div class="labelTabHeader">${group.label}</div>`));
elGroup.appendChild(elLegend);
tabs = tabs +'<button id="tab-'+ group.id +'" onclick="showPage(' + "'" + group.id + "'" + ');"><img src="tabs/'+ group.id +'.png"></button>';
//tabs = tabs +'<button id="tab-'+ group.id +'" title="' + group.label + '" onclick="showPage(' + "'" + group.id + "'" + ');"><img src="tabs/'+ group.id +'.png"></button>';
}
group.properties.forEach(function(propertyData) {
@ -4475,7 +4475,6 @@ function loaded() {
resetProperties();
disableProperties();
});
augmentSpinButtons();
@ -4492,7 +4491,7 @@ function loaded() {
}
function showOnTheSamePage(entityType) {
if(GROUPS_PER_TYPE[entityType].includes(currentTab) == false){
if (!GROUPS_PER_TYPE[entityType].includes(currentTab)) {
currentTab = "base";
}
showPage(currentTab);
@ -4501,7 +4500,7 @@ function showOnTheSamePage(entityType) {
function showPage(id) {
currentTab = id;
Object.entries(elGroups).forEach(([groupKey, elGroup]) => {
if (groupKey == id) {
if (groupKey === id) {
elGroup.style.display = "block";
document.getElementById("tab-" + groupKey).style.backgroundColor = "#2E2E2E";
} else {