fix position of mounth view
This commit is contained in:
parent
7b36ee9094
commit
99bcc99ce4
@ -17,6 +17,7 @@
|
||||
width: 100%;
|
||||
display: flex;
|
||||
min-width: 1000px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.frcal__month_first {
|
||||
|
||||
13
main.js
13
main.js
@ -293,7 +293,7 @@ class CalendarView extends ItemView
|
||||
this.eventsEls = {};
|
||||
|
||||
// mount view
|
||||
this.mountView = container.createEl("div", { cls: "frcal__mountView" });
|
||||
this.mountView = container.createEl('div', { attr: { style: "height:0" } }).createEl("div", { cls: "frcal__mountView" });
|
||||
|
||||
// month
|
||||
this.monthEl = container.createEl("div", { cls: "frcal__month" });
|
||||
@ -399,9 +399,11 @@ class CalendarView extends ItemView
|
||||
let table = this.mountView.createEl('table');
|
||||
for (let week = moment(startMonth); week < endMonth; week.add(1, "weeks"))
|
||||
{
|
||||
let date = stringifySingleDate(week).match(DateFormat.week);
|
||||
let row = table.createEl("tr", {
|
||||
attr: {
|
||||
onclick: "app.workspace.getLeavesOfType('" + VIEW_TYPE_CALENDAR + "')[0].view.mountViewClick('" + stringifySingleDate(week).match(DateFormat.week) + "')"
|
||||
'id': "frcal_mountview_" + date,
|
||||
'onclick': "app.workspace.getLeavesOfType('" + VIEW_TYPE_CALENDAR + "')[0].view.mountViewClick('" + date + "')"
|
||||
}
|
||||
});
|
||||
|
||||
@ -434,6 +436,13 @@ class CalendarView extends ItemView
|
||||
}
|
||||
}
|
||||
this.mountView.style.display = "block";
|
||||
setTimeout(() => {
|
||||
document.getElementById('frcal_mountview_' + stringifySingleDate(moment()).match(DateFormat.week)).scrollIntoView({
|
||||
behavior: 'instant',
|
||||
block: 'center',
|
||||
inline: 'center'
|
||||
});
|
||||
}, 10);
|
||||
}
|
||||
|
||||
mountViewClick(week)
|
||||
|
||||
Reference in New Issue
Block a user