background for datespopup + closes menu on open

This commit is contained in:
l_samenv
2024-08-30 10:49:22 +02:00
parent dc241ce246
commit 924a6a8d1d
3 changed files with 15 additions and 9 deletions

View File

@ -1,8 +1,7 @@
class DateIndicator extends HTMLElement{
constructor(timestamp, goToNowCallback, jumpCallback){
constructor(timestamp){
super();
this.formattedDate = this.timestampToString(timestamp);
this.datePopup = new DatesPopup(goToNowCallback, jumpCallback);
}
dayNumberToName(dayNumber){
@ -39,13 +38,9 @@ class DateIndicator extends HTMLElement{
this.getElementsByClassName("date-indicator")[0].textContent = this.formattedDate;
}
showPopup(){
this.datePopup.show();
}
connectedCallback(){
this.render();
this.getElementsByClassName("date-indicator")[0].onclick = () => {this.showPopup();};
}
render(){
@ -55,7 +50,6 @@ class DateIndicator extends HTMLElement{
${this.formattedDate}
</div>
`
this.appendChild(this.datePopup);
}
}