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

Function quick_info

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

Source from the content-addressed store, hash-verified

15274 };
15275 }
15276 function quick_info(scheduler2) {
15277 scheduler2.config.icons_select = ["icon_form", "icon_delete"];
15278 scheduler2.config.details_on_create = true;
15279 scheduler2.config.show_quick_info = true;
15280 scheduler2.xy.menu_width = 0;
15281 let clickedElementPosition = null;
15282 scheduler2.attachEvent("onSchedulerReady", function() {
15283 const container = scheduler2.$container;
15284 if (container._$quickInfoHandler) {
15285 return;
15286 } else {
15287 container._$quickInfoHandler = true;
15288 scheduler2.event(container, "mousedown", function(e) {
15289 const eventElement = e.target.closest(`[${scheduler2.config.event_attribute}]`);
15290 if (eventElement) {
15291 clickedElementPosition = { id: eventElement.getAttribute(scheduler2.config.event_attribute), position: getPositionInsideScheduler(eventElement) };
15292 }
15293 });
15294 scheduler2.attachEvent("onDestroy", () => {
15295 delete container._$quickInfoHandler;
15296 });
15297 }
15298 });
15299 scheduler2.attachEvent("onClick", function(id) {
15300 if (!scheduler2.config.show_quick_info) {
15301 return;
15302 }
15303 scheduler2.showQuickInfo(id);
15304 return true;
15305 });
15306 (function() {
15307 var events = ["onEmptyClick", "onViewChange", "onLightbox", "onBeforeEventDelete", "onBeforeDrag"];
15308 var hiding_function = function() {
15309 scheduler2.hideQuickInfo(true);
15310 return true;
15311 };
15312 for (var i = 0; i < events.length; i++) {
15313 scheduler2.attachEvent(events[i], hiding_function);
15314 }
15315 })();
15316 scheduler2.templates.quick_info_title = function(start, end, ev) {
15317 return ev.text.substr(0, 50);
15318 };
15319 scheduler2.templates.quick_info_content = function(start, end, ev) {
15320 return ev.details || "";
15321 };
15322 scheduler2.templates.quick_info_date = function(start, end, ev) {
15323 if (scheduler2.isOneDayEvent(ev) && scheduler2.config.rtl) {
15324 return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(end, start, ev);
15325 } else if (scheduler2.isOneDayEvent(ev)) {
15326 return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(start, end, ev);
15327 } else if (scheduler2.config.rtl) {
15328 return scheduler2.templates.week_date(end, start, ev);
15329 } else {
15330 return scheduler2.templates.week_date(start, end, ev);
15331 }
15332 };
15333 scheduler2.showQuickInfo = function(id) {

Callers

nothing calls this directly

Calls 15

cssTimeToMsFunction · 0.70
fitQIInsideWindowFunction · 0.70
attachEventMethod · 0.65
eventMethod · 0.65
showQuickInfoMethod · 0.65
isOneDayEventMethod · 0.65
day_dateMethod · 0.65
event_headerMethod · 0.65
week_dateMethod · 0.65
hideQuickInfoMethod · 0.65
callEventMethod · 0.65

Tested by

no test coverage detected