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

Function layer

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

Source from the content-addressed store, hash-verified

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