fixed but where last section in a container wouldn't delete. and finally squashed bug where moving last section down causes it to disappear

This commit is contained in:
2025-06-18 22:16:55 -04:00
parent c18056ee74
commit d7372b03bd
+9 -10
View File
@@ -871,9 +871,9 @@
/** SIZE */ /** SIZE */
const containerSettings = this.containerSettings; const containerSettings = this.containerSettings;
document.getElementById(this.id).style.width = this.width; document.getElementById(this.id).style.width = this.width + "px";
// this.width - 2 * parseInt(containerSettings.borderWidth); // this.width - 2 * parseInt(containerSettings.borderWidth);
document.getElementById(this.id).style.height = this.height; document.getElementById(this.id).style.height = this.height + "px";
// this.height - 2 * parseInt(containerSettings.borderWidth); // this.height - 2 * parseInt(containerSettings.borderWidth);
/** SHADOW / GLOW */ /** SHADOW / GLOW */
@@ -1175,16 +1175,14 @@
* [re]loads saved bookmark sections + links for container * [re]loads saved bookmark sections + links for container
*/ */
loadBookmarks() { loadBookmarks() {
if (Object.keys(this.sections).length == 0) {
return;
}
console.log('loading bookmarks...');
console.log(this.sections);
let containerSettings = this.containerSettings; let containerSettings = this.containerSettings;
let linkContainer = document.getElementById(this.id + "-sections"); let linkContainer = document.getElementById(this.id + "-sections");
linkContainer.innerHTML = ""; linkContainer.innerHTML = "";
if (Object.keys(this.sections).length == 0) {
return;
}
let sectionData = Object.values(this.sections); let sectionData = Object.values(this.sections);
// render the sections // render the sections
@@ -1927,7 +1925,9 @@
if (direction == "up" && sectionId != 0) { if (direction == "up" && sectionId != 0) {
container.sections[sectionId] = container.sections[sectionId - 1]; container.sections[sectionId] = container.sections[sectionId - 1];
container.sections[sectionId - 1] = copy; container.sections[sectionId - 1] = copy;
} else if (direction == "down" && (sectionId + 1) != Object.keys(container.sections[sectionId]).length) { } else if (direction == "down" && (sectionId + 1) != Object.keys(container.sections).length) {
console.log(sectionId);
console.log(Object.keys(container.sections).length);
container.sections[sectionId] = container.sections[sectionId + 1]; container.sections[sectionId] = container.sections[sectionId + 1];
container.sections[sectionId + 1] = copy; container.sections[sectionId + 1] = copy;
} }
@@ -1942,7 +1942,6 @@
// go through sections, starting with one to delete // go through sections, starting with one to delete
let numSections = Object.keys(container.sections).length; let numSections = Object.keys(container.sections).length;
console.log(numSections);
for (let i = sectionId; i < numSections; i++) { for (let i = sectionId; i < numSections; i++) {
container.sections[i] = container.sections[i+1]; container.sections[i] = container.sections[i+1];
} }