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

Function layer

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

Source from the content-addressed store, hash-verified

12992 })();
12993}
12994function layer(scheduler2) {
12995 scheduler2.attachEvent("onTemplatesReady", function() {
12996 this.layers.sort(function(a, b) {
12997 return a.zIndex - b.zIndex;
12998 });
12999 scheduler2._dp_init = function(dp) {
13000 dp._methods = ["_set_event_text_style", "", "changeEventId", "deleteEvent"];
13001 this.attachEvent("onEventAdded", function(id) {
13002 if (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)
13003 dp.setUpdated(id, true, "inserted");
13004 });
13005 this.attachEvent("onBeforeEventDelete", function(id) {
13006 if (this.getEvent(id) && this.getEvent(id).layer == dp.layer) {
13007 if (!this.validId(id))
13008 return;
13009 var z = dp.getState(id);
13010 if (z == "inserted" || this._new_event) {
13011 dp.setUpdated(id, false);
13012 return true;
13013 }
13014 if (z == "deleted")
13015 return false;
13016 if (z == "true_deleted")
13017 return true;
13018 dp.setUpdated(id, true, "deleted");
13019 return false;
13020 } else
13021 return true;
13022 });
13023 this.attachEvent("onEventChanged", function(id) {
13024 if (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)
13025 dp.setUpdated(id, true, "updated");
13026 });
13027 dp._getRowData = function(id, pref) {
13028 var ev = this.obj.getEvent(id);
13029 var data = {};
13030 for (var a in ev) {
13031 if (a.indexOf("_") === 0)
13032 continue;
13033 if (ev[a] && ev[a].getUTCFullYear)
13034 data[a] = this.obj._helpers.formatDate(ev[a]);
13035 else
13036 data[a] = ev[a];
13037 }
13038 return data;
13039 };
13040 dp._clearUpdateFlag = function() {
13041 };
13042 dp.attachEvent("insertCallback", scheduler2._update_callback);
13043 dp.attachEvent("updateCallback", scheduler2._update_callback);
13044 dp.attachEvent("deleteCallback", function(upd, id) {
13045 this.obj.setUserData(id, this.action_param, "true_deleted");
13046 this.obj.deleteEvent(id);
13047 });
13048 };
13049 (function() {
13050 var _cloneObj = function(obj) {
13051 if (obj === null || typeof obj != "object")

Callers

nothing calls this directly

Calls 15

_cloneObjFunction · 0.70
attachEventMethod · 0.65
getEventMethod · 0.65
getStateMethod · 0.65
setUserDataMethod · 0.65
deleteEventMethod · 0.65
createDataProcessorMethod · 0.65
initMethod · 0.65
setCurrentViewMethod · 0.65
resetLightboxMethod · 0.65
uidMethod · 0.65
api_dateMethod · 0.65

Tested by

no test coverage detected