Merge branch 'table' of https://scodoc.org/git/ScoDoc/ScoDoc into bac_a_sable_prod

This commit is contained in:
ScoDoc service 2023-05-11 18:05:35 +02:00
commit 48453aab86

View File

@ -1,3 +1,16 @@
function getCurrentScriptPath() {
// Get all the script elements on the page
var scripts = document.getElementsByTagName('script');
// Find the last script element (which is the currently executing script)
var currentScript = scripts[scripts.length - 1];
// Retrieve the src attribute of the script element
var scriptPath = currentScript.src;
return scriptPath;
}
class ref_competences extends HTMLElement { class ref_competences extends HTMLElement {
constructor() { constructor() {
super(); super();
@ -14,11 +27,7 @@ class ref_competences extends HTMLElement {
/* Style du module */ /* Style du module */
const styles = document.createElement('link'); const styles = document.createElement('link');
styles.setAttribute('rel', 'stylesheet'); styles.setAttribute('rel', 'stylesheet');
// if (location.href.split("/")[3] == "ScoDoc") { styles.setAttribute('href', getCurrentScriptPath() + '../css/ref-competences.css');
styles.setAttribute('href', '/ScoDoc/static/css/ref-competences.css');
// } else {
// styles.setAttribute('href', 'ref-competences.css');
// }
this.shadow.appendChild(styles); this.shadow.appendChild(styles);
} }