MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / extend$5

Function extend$5

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

Source from the content-addressed store, hash-verified

7140</div></div><div class='dhx_cal_larea'></div>`;
7141}
7142function extend$5(scheduler2) {
7143 scheduler2._init_touch_events = function() {
7144 var mobile = this.config.touch && ((navigator.userAgent.indexOf("Mobile") != -1 || navigator.userAgent.indexOf("iPad") != -1 || navigator.userAgent.indexOf("Android") != -1 || navigator.userAgent.indexOf("Touch") != -1) && !window.MSStream) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
7145 if (mobile) {
7146 this.xy.scroll_width = 0;
7147 this._mobile = true;
7148 }
7149 if (this.config.touch) {
7150 var touchEventsSupported = true;
7151 try {
7152 document.createEvent("TouchEvent");
7153 } catch (e) {
7154 touchEventsSupported = false;
7155 }
7156 if (touchEventsSupported) {
7157 this._touch_events(["touchmove", "touchstart", "touchend"], function(ev) {
7158 if (ev.touches && ev.touches.length > 1)
7159 return null;
7160 if (ev.touches[0])
7161 return { target: ev.target, pageX: ev.touches[0].pageX, pageY: ev.touches[0].pageY, clientX: ev.touches[0].clientX, clientY: ev.touches[0].clientY };
7162 else
7163 return ev;
7164 }, function() {
7165 return false;
7166 });
7167 } else if (window.PointerEvent || window.navigator.pointerEnabled) {
7168 this._touch_events(["pointermove", "pointerdown", "pointerup"], function(ev) {
7169 if (ev.pointerType == "mouse")
7170 return null;
7171 return ev;
7172 }, function(ev) {
7173 return !ev || ev.pointerType == "mouse";
7174 });
7175 } else if (window.navigator.msPointerEnabled) {
7176 this._touch_events(["MSPointerMove", "MSPointerDown", "MSPointerUp"], function(ev) {
7177 if (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE)
7178 return null;
7179 return ev;
7180 }, function(ev) {
7181 return !ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE;
7182 });
7183 }
7184 }
7185 };
7186 scheduler2._touch_events = function(names, accessor, ignore) {
7187 var source, tracker, timer, drag_mode, scroll_mode, action_mode;
7188 var dblclicktime = 0;
7189 function attachTouchEvent(element, name, callback) {
7190 scheduler2.event(element, name, function(e) {
7191 if (scheduler2._is_lightbox_open()) {
7192 return true;
7193 } else {
7194 if (ignore(e))
7195 return;
7196 return callback(e);
7197 }
7198 }, { passive: false });
7199 }

Callers 1

factoryMethodFunction · 0.70

Calls 11

attachTouchEventFunction · 0.70
ignoreFunction · 0.70
doMouseMoveFunction · 0.70
check_direction_swipeFunction · 0.70
drag_cancelFunction · 0.70
addMethod · 0.65
updateEventMethod · 0.65
eventMethod · 0.65
getEventMethod · 0.65
event_headerMethod · 0.65
day_dateMethod · 0.65

Tested by

no test coverage detected