add links to mountView
This commit is contained in:
parent
11ca02bb91
commit
5a079ff413
@ -9,14 +9,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.frcal__time {
|
.frcal__time {
|
||||||
flex: 3;
|
flex: 2;
|
||||||
border-right: var(--color-base-40) 1px solid;
|
border-right: var(--color-base-40) 1px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.frcal__month {
|
.frcal__month {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
/*position: fixed;*/
|
min-width: 1000px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.frcal__month_first {
|
.frcal__month_first {
|
||||||
@ -36,7 +36,7 @@
|
|||||||
.frcal__days {
|
.frcal__days {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
min-width: 700px;
|
min-width: 1000px;
|
||||||
}
|
}
|
||||||
.frcal__day {
|
.frcal__day {
|
||||||
flex: 10;
|
flex: 10;
|
||||||
@ -159,8 +159,12 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.frcal__mountView tr:hover {
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
.frcal__month_month {
|
.frcal__month_month {
|
||||||
border-bottom: 1px solid var(--text-normal);
|
background-color: var(--background-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.frcal__weekinmonth {
|
.frcal__weekinmonth {
|
||||||
|
|||||||
14
main.js
14
main.js
@ -399,7 +399,11 @@ class CalendarView extends ItemView
|
|||||||
let table = this.mountView.createEl('table');
|
let table = this.mountView.createEl('table');
|
||||||
for (let week = moment(startMonth); week < endMonth; week.add(1, "weeks"))
|
for (let week = moment(startMonth); week < endMonth; week.add(1, "weeks"))
|
||||||
{
|
{
|
||||||
let row = table.createEl("tr");
|
let row = table.createEl("tr", {
|
||||||
|
attr: {
|
||||||
|
onclick: "app.workspace.getLeavesOfType('" + VIEW_TYPE_CALENDAR + "')[0].view.mountViewClick('" + stringifySingleDate(week).match(DateFormat.week) + "')"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let thursday = moment(week).day(4);
|
let thursday = moment(week).day(4);
|
||||||
|
|
||||||
@ -414,7 +418,7 @@ class CalendarView extends ItemView
|
|||||||
lastDayOfMount.add(1, "weeks");
|
lastDayOfMount.add(1, "weeks");
|
||||||
}
|
}
|
||||||
// let span = moment(week).add(1, "months").date(4).isoWeek() - week.isoWeek();
|
// let span = moment(week).add(1, "months").date(4).isoWeek() - week.isoWeek();
|
||||||
row.createEl("td", { attr: { rowspan: span, cls: 'frcal__month_month' } }).innerText = (thursday.month() + 1).toString() + " - " + DateFormat.months[thursday.month()];
|
row.createEl("td", { attr: { rowspan: span }, cls: 'frcal__month_month' }).innerText = (thursday.month() + 1).toString() + " - " + DateFormat.months[thursday.month()];
|
||||||
}
|
}
|
||||||
|
|
||||||
row.createEl('td', { cls: 'frcal__weekinmonth' }).innerText = week.isoWeek();
|
row.createEl('td', { cls: 'frcal__weekinmonth' }).innerText = week.isoWeek();
|
||||||
@ -431,6 +435,12 @@ class CalendarView extends ItemView
|
|||||||
}
|
}
|
||||||
this.mountView.style.display = "block";
|
this.mountView.style.display = "block";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mountViewClick(week)
|
||||||
|
{
|
||||||
|
this.mountView.style.display = "none";
|
||||||
|
this.gotoThisWeek(week);
|
||||||
|
}
|
||||||
|
|
||||||
async onClose()
|
async onClose()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user