link reodering works! bookmark functionality complete(?). bells and
whistles to come
This commit is contained in:
+25
-6
@@ -765,8 +765,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// [re]render the link listings
|
// [re]render the link listings
|
||||||
for (let s = 0; s < sectionData.length; s++) {
|
for (let s = sectionData.length - 1; s >= 0; s--) {
|
||||||
for (let l = 0; l < sectionData[s].links.length; l++) {
|
for (let l = sectionData[s].links.length - 1; l >= 0; l--) {
|
||||||
let targetSection = document.getElementById(
|
let targetSection = document.getElementById(
|
||||||
this.id + "-section-listing--" + s
|
this.id + "-section-listing--" + s
|
||||||
);
|
);
|
||||||
@@ -803,8 +803,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
createSettingsMenuListing() {
|
createSettingsMenuListing() {
|
||||||
console.log(this.id);
|
|
||||||
console.log(Object.keys(this.sections).length == 0 );
|
|
||||||
document.getElementById("containers").insertAdjacentHTML(
|
document.getElementById("containers").insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
`
|
`
|
||||||
@@ -1320,8 +1318,6 @@
|
|||||||
this.id + "-section-" + s
|
this.id + "-section-" + s
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(s, l);
|
|
||||||
|
|
||||||
targetSection.insertAdjacentHTML(
|
targetSection.insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
`
|
`
|
||||||
@@ -2066,6 +2062,29 @@
|
|||||||
container.loadBookmarkListings();
|
container.loadBookmarkListings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function reorderLink(buttonPressed, direction) {
|
||||||
|
let temp = buttonPressed.parentElement.parentElement.id.split("--");
|
||||||
|
let container = containerDataMap.get(temp[0].split("-")[0]);
|
||||||
|
const sectionIndex = parseInt(temp[temp.length - 2]);
|
||||||
|
const linkIndex = parseInt(temp[temp.length - 1]);
|
||||||
|
let links = container.sections[sectionIndex].links;
|
||||||
|
|
||||||
|
// cut out section and re-insert into array
|
||||||
|
let link = container.sections[sectionIndex].links[linkIndex];
|
||||||
|
container.sections[sectionIndex].links.splice(linkIndex, 1);
|
||||||
|
if (direction == "up" && linkIndex != 0) {
|
||||||
|
console.log("up: " + linkIndex);
|
||||||
|
links.splice(linkIndex - 1, 0, link);
|
||||||
|
} else if (direction == "down" && linkIndex != links.length) {
|
||||||
|
console.log("down: " + linkIndex);
|
||||||
|
links.splice(linkIndex + 1, 0, link);
|
||||||
|
}
|
||||||
|
|
||||||
|
// refresh screen
|
||||||
|
container.loadBookmarks();
|
||||||
|
container.loadBookmarkListings();
|
||||||
|
}
|
||||||
|
|
||||||
/******************
|
/******************
|
||||||
* IMAGE HANDLERS *
|
* IMAGE HANDLERS *
|
||||||
******************/
|
******************/
|
||||||
|
|||||||
Reference in New Issue
Block a user