diff --git a/projet/front/show-content.js b/projet/front/show-content.js index 3c0c1542e671729cb4a2439544e514b9724cd2b9..cb8518cfa0bd7d151aa1dd1f7e348f957ed308fb 100644 --- a/projet/front/show-content.js +++ b/projet/front/show-content.js @@ -4,7 +4,7 @@ function change_path(path){ document.getElementById("content-drive").innerHTML = ""; $.ajax({url: 'change-path'+path, success: function(result){ console.log(result); - document.getElementById("dir_name").innerHTML = "Directory : " + path; + appendLinkToParent(path, result[0].parent); for (let i in result){ if (result[i].file_id){ new_file(result[i].file_name, result[i].file_id); @@ -18,6 +18,14 @@ function change_path(path){ }}); } +function appendLinkToParent(path, parent){ + let el = document.getElementById("dir_name"); + el.innerHTML = ` + Directory : ${path} + `; + +} + function login() { let username = document.getElementById("username").value let passwd = document.getElementById("passwd").value