Fix bug when screen is larger.(it will trigger maximum call statck size exceeded)

This commit is contained in:
BoHung Chiu 2021-12-09 13:30:33 +08:00
parent 388ada1ae3
commit 70388806c6
2 changed files with 20 additions and 16 deletions

View File

@ -7603,10 +7603,12 @@ var FullCalendar = (function (exports) {
return parseBusinessHours(calendarContext.options.businessHours, calendarContext);
}
function warnUnknownOptions(options, viewName) {
if(!viewName) return 0;
for (var optionName in options) {
console.warn("Unknown option '" + optionName + "'" +
(viewName ? " for view '" + viewName + "'" : ''));
}
return 0;
}
// TODO: move this to react plugin?
@ -7692,29 +7694,31 @@ var FullCalendar = (function (exports) {
// returns number of new entries inserted
SegHierarchy.prototype.handleInvalidInsertion = function (insertion, entry, hiddenEntries) {
if (this.allowReslicing && insertion.touchingEntry) {
return this.splitEntry(entry, insertion.touchingEntry, hiddenEntries);
return this.splitEntry(entry, insertion.touchingEntry, hiddenEntries, true);
}
hiddenEntries.push(entry);
return 0;
};
SegHierarchy.prototype.splitEntry = function (entry, barrier, hiddenEntries) {
SegHierarchy.prototype.splitEntry = function (entry, barrier, hiddenEntries, invalid_call) {
var partCnt = 0;
var splitHiddenEntries = [];
var entrySpan = entry.span;
var barrierSpan = barrier.span;
if (entrySpan.start < barrierSpan.start) {
partCnt += this.insertEntry({
index: entry.index,
thickness: entry.thickness,
span: { start: entrySpan.start, end: barrierSpan.start },
}, splitHiddenEntries);
}
if (entrySpan.end > barrierSpan.end) {
partCnt += this.insertEntry({
index: entry.index,
thickness: entry.thickness,
span: { start: barrierSpan.end, end: entrySpan.end },
}, splitHiddenEntries);
if(!invalid_call){
if (entrySpan.start < barrierSpan.start) {
partCnt += this.insertEntry({
index: entry.index,
thickness: entry.thickness,
span: { start: entrySpan.start, end: barrierSpan.start },
}, splitHiddenEntries);
}
if (entrySpan.end > barrierSpan.end) {
partCnt += this.insertEntry({
index: entry.index,
thickness: entry.thickness,
span: { start: barrierSpan.end, end: entrySpan.end },
}, splitHiddenEntries);
}
}
if (partCnt) {
hiddenEntries.push.apply(hiddenEntries, __spreadArray([{

File diff suppressed because one or more lines are too long