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

Function createMethod

codebase/sources/dhtmlxscheduler.es.js:1034–1130  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

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