fixed refacto of this.buildosUrl

This commit is contained in:
STEINNI
2026-03-21 19:01:42 +00:00
parent e58ff43014
commit 4122545cff
6 changed files with 63 additions and 14 deletions

View File

@@ -12,9 +12,17 @@
*/
class Buildoz extends HTMLElement {
// static is evaluated when the class is defined, therefore while buildoz.js is executing.
// therefore document.currentScript refers to buildoz.js (but not later!!)
static _buildozUrl = document.currentScript?.src ?? ''
constructor(){
super() // always call super() first!
this.attrs = {}
// Usefull for relative dependencies, to keep lib fully portable
this.buildozUrl = Buildoz._buildozUrl // was defined in the past
}
static get observedAttributes(){ //observable attributes triggering attributeChangedCallback