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

File diff suppressed because one or more lines are too long