WebFM/resources/js/favorites.js

35 lines
932 B
JavaScript
Raw Normal View History

const faveManager = (elm) => {
let path = document.getElementById("path").innerHTML;
let data = "";
if (elm.style.backgroundColor != "") {
elm.style.backgroundColor = "";
elm.style.color = "";
data = "deleteLink=true";
} else {
elm.style.backgroundColor = "rgb(255, 255, 255)";
elm.style.color = "rgb(0, 0, 0)";
data = "deleteLink=false";
}
data += "&linkPath=" + path;
doAjax("resources/php/dbController.php", data);
}
2018-08-25 21:10:09 +00:00
// Basically resetting path nodes and setting them up
// to the new path and just doing a refresh
const loadFave = (elm) => {
2018-12-09 21:40:23 +00:00
let path = elm.getAttribute("name");
let parts = path.split("/");
let size = parts.length;
2018-08-25 21:10:09 +00:00
pathNodes = [];
pathNodes.push(parts[0] + "/");
for (let i = 1; i < size - 1; i++) {
2018-08-25 21:10:09 +00:00
pathNodes.push(parts[i] + "/");
}
pathNodes.push(parts[size - 1]);
getDir("./");
}