MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / createMethod

Function createMethod

codebase/sources/dhtmlxscheduler.js:1038–1134  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

1036 };
1037 }
1038 function createMethod(scheduler2) {
1039 var methods = {};
1040 var isActive = false;
1041 function disableMethod(methodName, dummyMethod) {
1042 dummyMethod = typeof dummyMethod == "function" ? dummyMethod : function() {
1043 };
1044 if (!methods[methodName]) {
1045 methods[methodName] = this[methodName];
1046 this[methodName] = dummyMethod;
1047 }
1048 }
1049 function restoreMethod(methodName) {
1050 if (methods[methodName]) {
1051 this[methodName] = methods[methodName];
1052 methods[methodName] = null;
1053 }
1054 }
1055 function disableMethods(methodsHash) {
1056 for (var i in methodsHash) {
1057 disableMethod.call(this, i, methodsHash[i]);
1058 }
1059 }
1060 function restoreMethods() {
1061 for (var i in methods) {
1062 restoreMethod.call(this, i);
1063 }
1064 }
1065 function batchUpdatePayload(callback) {
1066 try {
1067 callback();
1068 } catch (e) {
1069 window.console.error(e);
1070 }
1071 }
1072 scheduler2.$stateProvider.registerProvider("batchUpdate", function() {
1073 return { batch_update: isActive };
1074 }, false);
1075 return function batchUpdate2(callback, noRedraw) {
1076 if (isActive) {
1077 batchUpdatePayload(callback);
1078 return;
1079 }
1080 var call_dp = this._dp && this._dp.updateMode != "off";
1081 var dp_mode;
1082 if (call_dp) {
1083 dp_mode = this._dp.updateMode;
1084 this._dp.setUpdateMode("off");
1085 }
1086 const calls = { setModeDate: { date: null, mode: null }, needRender: false, needUpdateView: false, repaintEvents: {} };
1087 const rememberModeDate = (date, mode) => {
1088 if (date) {
1089 calls.setModeDate.date = date;
1090 }
1091 if (mode) {
1092 calls.setModeDate.mode = mode;
1093 }
1094 };
1095 var methods2 = { render: (date, mode) => {

Callers 1

batchUpdateFunction · 0.70

Calls 6

batchUpdatePayloadFunction · 0.70
rememberModeDateFunction · 0.70
callEventMethod · 0.65
renderMethod · 0.65
updateViewMethod · 0.65
updateEventMethod · 0.65

Tested by

no test coverage detected