background for datespopup + closes menu on open
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user