mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 15:06:06 +00:00
calendar mode buttons change
This commit is contained in:
@@ -121,28 +121,19 @@ class CalendarModeButtons extends View {
|
||||
}
|
||||
});
|
||||
|
||||
if (currentIndex >= this.visibleModeListCount) {
|
||||
const tmp = list[this.visibleModeListCount - 1];
|
||||
|
||||
list[this.visibleModeListCount - 1] = list[currentIndex];
|
||||
list[currentIndex] = tmp;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
getVisibleModeDataList() {
|
||||
const fullList = this.getModeDataList();
|
||||
|
||||
const list = [];
|
||||
const current = fullList.find(it => it.mode === this.mode);
|
||||
|
||||
fullList.forEach((o, i) => {
|
||||
if (i >= this.visibleModeListCount) {
|
||||
return;
|
||||
}
|
||||
const list = fullList.slice(0, this.visibleModeListCount);
|
||||
|
||||
list.push(o);
|
||||
});
|
||||
if (current && !list.find(it => it.mode === this.mode)) {
|
||||
list.push(current);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user