MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / enable

Function enable

core/src/utils/gesture/pointer-events.ts:108–126  ·  view source on GitHub ↗
(isEnabled = true)

Source from the content-addressed store, hash-verified

106 };
107
108 const enable = (isEnabled = true) => {
109 if (!isEnabled) {
110 if (rmTouchStart) {
111 rmTouchStart();
112 }
113 if (rmMouseStart) {
114 rmMouseStart();
115 }
116 rmTouchStart = rmMouseStart = undefined;
117 stop();
118 } else {
119 if (!rmTouchStart) {
120 rmTouchStart = addEventListener(el, 'touchstart', handleTouchStart, options);
121 }
122 if (!rmMouseStart) {
123 rmMouseStart = addEventListener(el, 'mousedown', handleMouseDown, options);
124 }
125 }
126 };
127
128 const destroy = () => {
129 enable(false);

Callers 1

destroyFunction · 0.70

Calls 2

addEventListenerFunction · 0.90
stopFunction · 0.70

Tested by

no test coverage detected