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

Function quick_info

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

Source from the content-addressed store, hash-verified

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