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

Function active_links

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

Source from the content-addressed store, hash-verified

9472 }
9473}
9474function active_links(scheduler2) {
9475 scheduler2.config.active_link_view = "day";
9476 scheduler2._active_link_click = function(e) {
9477 var start = e.target;
9478 var to = start.getAttribute("data-link-date");
9479 var s_d = scheduler2.date.str_to_date(scheduler2.config.api_date, false, true);
9480 if (to) {
9481 scheduler2.setCurrentView(s_d(to), scheduler2.config.active_link_view);
9482 if (e && e.preventDefault)
9483 e.preventDefault();
9484 return false;
9485 }
9486 };
9487 scheduler2.attachEvent("onTemplatesReady", function() {
9488 var do_wrapper = function(key2, fullname) {
9489 fullname = fullname || key2 + "_scale_date";
9490 if (!scheduler2.templates["_active_links_old_" + fullname]) {
9491 scheduler2.templates["_active_links_old_" + fullname] = scheduler2.templates[fullname];
9492 }
9493 var week_x = scheduler2.templates["_active_links_old_" + fullname];
9494 var d_s = scheduler2.date.date_to_str(scheduler2.config.api_date);
9495 scheduler2.templates[fullname] = function(date) {
9496 return "<a data-link-date='" + d_s(date) + "' href='#'>" + week_x(date) + "</a>";
9497 };
9498 };
9499 do_wrapper("week");
9500 do_wrapper("", "month_day");
9501 if (this.matrix) {
9502 for (var key in this.matrix)
9503 do_wrapper(key);
9504 }
9505 this._detachDomEvent(this._obj, "click", scheduler2._active_link_click);
9506 scheduler2.event(this._obj, "click", scheduler2._active_link_click);
9507 });
9508}
9509function agenda_legacy(scheduler2) {
9510 scheduler2.date.add_agenda_legacy = function(date) {
9511 return scheduler2.date.add(date, 1, "year");

Callers

nothing calls this directly

Calls 5

do_wrapperFunction · 0.70
str_to_dateMethod · 0.65
setCurrentViewMethod · 0.65
attachEventMethod · 0.65
eventMethod · 0.65

Tested by

no test coverage detected